The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix stroke corners

These changes was commited to the Birdfont repository Fri, 09 Oct 2015 09:16:33 +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>
Fri, 09 Oct 2015 09:16:33 +0000 (11:16 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 09 Oct 2015 09:16:33 +0000 (11:16 +0200)
commit ec82ded008ea6dc1080f537fca3c02af7406513d
tree 6499f8e85996ba3797b9acfaa71b3aa15aa7025c
parent 5212c07291c4ceafd3b43f80042e375b5b6c10db
Fix stroke corners

libbirdfont/EditPoint.vala
libbirdfont/Path.vala
--- a/libbirdfont/EditPoint.vala +++ b/libbirdfont/EditPoint.vala @@ -614,6 +614,7 @@ s.append (@"Left handle: angle: $(left_handle.angle) l: $(left_handle.length)\n"); s.append (@"Right handle: angle: $(right_handle.angle) l: $(right_handle.length)\n"); s.append (@"Type: $type Left: $(left_handle.type) Right: $(right_handle.type)\n".replace ("BIRD_FONT_POINT_TYPE_", "")); + s.append (@"Flags $(flags)\n"); return s.str; }
--- a/libbirdfont/Path.vala +++ b/libbirdfont/Path.vala @@ -2304,8 +2304,12 @@ EditPoint ep = points.get (i % points.size); if (ep.get_right_handle ().length < t3 && ep.get_left_handle ().length < t3 - && !is_endpoint (ep)) { + && !is_endpoint (ep) + && (ep.flags & EditPoint.CURVE_KEEP) == 0 + && (ep.flags & EditPoint.SEGMENT_END) == 0) { ep.deleted = true; + warning (ep.to_string ()); + warning (@"A: EditPoint.CURVE_KEEP: $(EditPoint.CURVE_KEEP) $(ep.flags & EditPoint.CURVE_KEEP)"); } } @@ -2315,14 +2319,8 @@ EditPoint ep = points.get (i % points.size); n = points.get ((i + 1) % points.size); - if ((ep.flags & EditPoint.NEW_CORNER) == 0) { - if (ep.get_right_handle ().length < t - && ep.get_left_handle ().length < t - && !is_endpoint (ep)) { - ep.deleted = true; - } else if (Path.distance_to_point (n, ep) < t) { - remove.add (ep); - } + if (Path.distance_to_point (n, ep) < t) { + remove.add (ep); } }