The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Set orientation in merge code

These changes was commited to the Birdfont repository Fri, 14 Aug 2015 06:29:38 +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 06:29:38 +0000]

Updated Files

libbirdfont/StrokeTool.vala
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -136,6 +136,7 @@ reset_flags (o); + new_paths.append (o); for (int i = 0; i < o.paths.size; i++) { for (int j = 0; j < o.paths.size; j++) { Path p1, p2; @@ -143,7 +144,7 @@ p1 = o.paths.get (i); p2 = o.paths.get (j); - if (i == j) { // merge self intersections + if (i == j) { continue; } @@ -165,9 +166,9 @@ if (r.paths.size > 0) { reset_flags (r); new_paths.append (r); - - //removed_paths.add (p1); - //removed_paths.add (p2); + + new_paths.remove (p1); + new_paths.remove (p2); i = 0; j = 0; @@ -194,6 +195,7 @@ g.add_active_path (null, p); } + PenTool.update_orientation (); GlyphCanvas.redraw (); } @@ -238,7 +240,6 @@ } } - print (@"clockwise $clockwise counters $counters pl.size $(pl.paths.size)\n"); if (p.is_clockwise ()) { @@ -610,8 +611,14 @@ } if ((ep1.flags & EditPoint.SELF_INTERSECTION) > 0) { + bool other; + ep1.flags |= EditPoint.COPIED; merged.add_point (ep1.copy ()); + + new_start = intersections.get_point (ep1, out other); + ep2 = new_start.get_other_point (current); + ep1.right_handle.move_to_coordinate (ep2.right_handle.x, ep2.right_handle.y); } print (@"Break at $(ep1.x), $(ep1.y)\n");