The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix merge bugs

These changes was commited to the Birdfont repository Fri, 03 Jul 2015 09:17:39 +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, 03 Jul 2015 09:17:39 +0000]

Updated Files

libbirdfont/StrokeTool.vala
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -111,7 +111,7 @@ foreach (Path p in g.active_paths) { if (p.stroke == 0) { o.add (p.copy ()); - flat.add (p.copy ().flatten (100)); + flat.add (p.copy ().flatten (50)); } } @@ -127,10 +127,17 @@ if (Path.distance_to_point (ep, lep) < 1) { pp.insert_new_point_on_path (lep); lep.flags |= EditPoint.INTERSECTION; + lep.tie_handles = false; + lep.reflective_point = false; } } } } + } + + //FIXME:DELETE + foreach (Path pp in flat.paths) { + ((!) BirdFont.get_current_font ().get_glyph_by_name ("a")).add_path (pp); } o = merge_curves (o, flat); @@ -144,6 +151,12 @@ g.clear_active_paths (); foreach (Path p in o.paths) { + foreach (EditPoint ep in p.points) { + ep.flags &= uint.MAX ^ (EditPoint.INTERSECTION | EditPoint.COPIED | EditPoint.NEW_CORNER); + ep.flags = 0; + } + p.update_region_boundaries (); + g.add_path (p); g.add_active_path (null, p); } @@ -309,7 +322,10 @@ bool inside = (current == path1 && flat2.is_over_coordinate (px, py)) || (current == path2 && flat1.is_over_coordinate (px, py)); - if (inside) { + bool other_inside = (current != path1 && flat2.is_over_coordinate (px, py)) + || (current != path2 && flat1.is_over_coordinate (px, py)); + + if (inside && !other_inside) { print (@"Middle point is inside $px $py\n"); current = new_start.get_other_path (current); i = index_of (current, new_start.get_point (current)); @@ -324,12 +340,15 @@ } else { print (@"Outside $px $py\n"); } - + + inside = (current == path1 && flat2.is_over_coordinate (px, py)) + || (current == path2 && flat1.is_over_coordinate (px, py)); + if (first) { //previous = new_start.get_other_path (current).get_first_point (); previous = new_start.get_other_point (current); first = false; - } + } ep1.left_handle = previous.left_handle.copy (); }