The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Intersection in stroke corner

These changes was commited to the Birdfont repository Thu, 07 May 2015 12:03:59 +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, 07 May 2015 12:03:59 +0000 (14:03 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 07 May 2015 12:03:59 +0000 (14:03 +0200)
commit fc3845d5d87ba6b49e785ae7f51ede5ae969b3a1
tree 256df9bcc29020dd4bf5a6c41583842030f2eb3d
parent 4074760a4cec542b88e09d30c7884cb76a99a54c
Intersection in stroke corner

libbirdfont/StrokeTool.vala
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -109,8 +109,7 @@ o = create_stroke (stroke, thickness, false); o = get_all_parts (o); o = merge (o); - - + m = new PathList (); foreach (Path p in o.paths) { m.add (simplify_stroke (p)); @@ -428,14 +427,16 @@ bool d1 = corner.x - previous.x > 0 == previous.x - previous.get_prev ().x > 0; bool d2 = corner.y - previous.y > 0 == previous.y - previous.get_prev ().y > 0; - - if (!d1 && !d2) { + + if (!d1 && !d2) { // self intersection cutoff1.deleted = true; cutoff2.deleted = true; stroked.remove_deleted_points (); + stroked.add (cutoff1.x + (cutoff2.x - cutoff1.x) / 2, cutoff1.y + (cutoff2.y - cutoff1.y) / 2); + return; - } + } if (distance > 4 * stroke_width) { previous.flags = EditPoint.NONE; @@ -2103,7 +2104,6 @@ foreach (Path p in pl.paths) { p.close (); convert_to_curve (p); - p.recalculate_linear_handles (); } }