The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Bottom margin in expander

These changes was commited to the Birdfont repository Sun, 31 May 2015 14:24:35 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 31 May 2015 14:24:35 +0000 (16:24 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 31 May 2015 14:27:34 +0000 (16:27 +0200)
commit 7fafaebe32881331a5e00129bd651e937eaead2d
tree 8db843d5d75639c14066acd835154aed2aa22cde
parent 1b774c6db3e739c16a33fd4cfe985ba9e968afbd
Bottom margin in expander

libbirdfont/Expander.vala
libbirdfont/Renderer/Text.vala
--- a/libbirdfont/Expander.vala +++ b/libbirdfont/Expander.vala @@ -152,7 +152,7 @@ t.x = xt; t.y = yt; //content_height += t.h; - yt += t.h + 7 * scale; + yt += t.h + 7 * scale; previous = t; continue; } @@ -166,9 +166,7 @@ xt = x; yt += previous.h; - if (t is LabelTool) { - // yt += 0 * scale; - } else { + if (!(t is LabelTool)) { yt += 7 * scale; } } @@ -186,6 +184,8 @@ first_row = false; } } + + content_height += 5 * scale; } }
--- a/libbirdfont/Renderer/Text.vala +++ b/libbirdfont/Renderer/Text.vala @@ -451,7 +451,8 @@ EditPoint e, prev; double xa, ya, xb, yb, xc, yc, xd, yd; double by; - + double s = get_scale (); + if (path.points.size > 0) { if (unlikely (path.is_open ())) { warning (@"Path is open in $(glyph.get_name ())."); @@ -460,25 +461,25 @@ //path.add_hidden_double_points (); // FIXME: this distorts shapes prev = path.points.get (path.points.size - 1); - xa = (prev.x - lsb) * scale + x; - ya = y - prev.y * scale; + xa = (prev.x - lsb) * s + x; + ya = y - prev.y * s; cr.move_to (xa, ya); - by = (y - cached_font.base_line * scale); + by = (y - cached_font.base_line * s); for (int i = 0; i < path.points.size; i++) { e = path.points.get (i).copy (); PenTool.convert_point_segment_type (prev, e, PointType.CUBIC); - xb = (prev.get_right_handle ().x - lsb) * scale + x; - yb = by - prev.get_right_handle ().y * scale; + xb = (prev.get_right_handle ().x - lsb) * s + x; + yb = by - prev.get_right_handle ().y * s; - xc = (e.get_left_handle ().x - lsb) * scale + x; - yc = by - e.get_left_handle ().y * scale; + xc = (e.get_left_handle ().x - lsb) * s + x; + yc = by - e.get_left_handle ().y * s; - xd = (e.x - lsb) * scale + x; - yd = by - e.y * scale; - + xd = (e.x - lsb) * s + x; + yd = by - e.y * s; + cr.curve_to (xb, yb, xc, yc, xd, yd); cr.line_to (xd, yd);