The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Don't add corners to lines

These changes was commited to the Birdfont repository Mon, 27 Apr 2015 19:57:03 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Mon, 27 Apr 2015 19:57:03 +0000]

Updated Files

libbirdfont/StrokeTool.vala
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -1691,6 +1691,8 @@ double step_size; EditPoint corner1, corner1_inside; double step; + + EditPointHandle l, r; side1 = new Path (); side2 = new Path (); @@ -1770,13 +1772,18 @@ side2.add_point (corner1_inside.copy ()); previous = corner1; previous_inside = corner1_inside; + + l = p2.get_left_handle (); + r = p2.get_right_handle (); - if (!path.is_open () || i < size - 1) { - get_segment (thickness, 0, 0.001, p2, p3, out start); - add_corner (side1, previous, start, p2.copy (), thickness); + if (fabs (l.angle - r.angle - PI) % 2 * PI > 0.0001) { + if (!path.is_open () || i < size - 1) { + get_segment (thickness, 0, 0.001, p2, p3, out start); + add_corner (side1, previous, start, p2.copy (), thickness); - get_segment (-thickness, 0, 0.001, p2, p3, out start); - add_corner (side2, previous_inside, start, p2.copy (), thickness); + get_segment (-thickness, 0, 0.001, p2, p3, out start); + add_corner (side2, previous_inside, start, p2.copy (), thickness); + } } }