The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Don't merge empty paths

These changes was commited to the Birdfont repository Fri, 14 Aug 2015 14:14:31 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 14 Aug 2015 14:14:31 +0000]

Updated Files

libbirdfont/StrokeTool.vala
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -725,7 +725,11 @@ || (current == path2 && flat1.is_over_coordinate (px, py)); if (first) { - previous = new_start.get_other_path (current).get_first_point (); + Path c = new_start.get_other_path (current); + if (c.points.size >= 1) { + previous = c.get_first_point (); + } + first = false; } } @@ -733,17 +737,20 @@ if ((ep1.flags & EditPoint.COPIED) > 0) { new_path.close (); - EditPoint first_point = new_path.get_first_point (); - EditPointHandle h; - if ((ep1.flags & EditPoint.INTERSECTION) > 0) { - first_point.left_handle.move_to_coordinate (previous.left_handle.x, previous.left_handle.y); - - if (first_point.next != null) { - h = first_point.get_next ().get_left_handle (); - h.process_connected_handle (); + + if (new_path.points.size >= 1) { + EditPoint first_point = new_path.get_first_point (); + EditPointHandle h; + if ((ep1.flags & EditPoint.INTERSECTION) > 0) { + first_point.left_handle.move_to_coordinate (previous.left_handle.x, previous.left_handle.y); + + if (first_point.next != null) { + h = first_point.get_next ().get_left_handle (); + h.process_connected_handle (); + } } } - + break; }