The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

More merge code

These changes was commited to the Birdfont repository Thu, 02 Jul 2015 11:46: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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 02 Jul 2015 11:46:31 +0000 (13:46 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 02 Jul 2015 11:46:31 +0000 (13:46 +0200)
commit 4b30efc3983f1faccf1fb4f567cc7e3ed8955187
tree 559ef2d22ae35b77f824f9c5e1d186805c4ec0b8
parent 1f21960284a129dcb4422944636733042f5ec6ba
More merge code

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 ()); + flat.add (p.copy ().flatten (100)); } } @@ -255,6 +255,7 @@ new_path.get_last_point ().color = Color.yellow (); new_path.get_last_point ().get_prev ().color = Color.blue (); new_path.close (); + new_path.recalculate_linear_handles (); r.add (new_path); } @@ -277,11 +278,13 @@ new_path = new Path (); ep1 = current.points.get (i); current = new_start.get_other_path (current); // swap at first iteration + bool first = true; while (true) { if ((ep1.flags & EditPoint.INTERSECTION) > 0) { bool other; previous = ep1; + new_start = intersections.get_point (ep1, out other); current = new_start.get_other_path (current); i = index_of (current, new_start.get_point (current)); @@ -292,15 +295,12 @@ } ep1 = current.points.get (i); - - // skip two points ep2 = current.points.get ((i + 1) % current.points.size); double px, py; Path.get_point_for_step (ep1, ep2, 0.5, out px, out py); - //print (ep1.to_string ()); - //print (ep2.to_string ()); + // FIXME: for merging outline with counters print (@"Path1 $(current == path1) && $(flat2.is_over_coordinate (px, py)) $(ep1.x), $(ep1.y)\n"); @@ -324,12 +324,17 @@ } else { print (@"Outside $px $py\n"); } + + 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 (); } if ((ep1.flags & EditPoint.COPIED) > 0) { - //new_path.add_point (ep1.copy ()); print ("Copied, part done.\n"); break; }