The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix curve handles in SVG parser

These changes was commited to the Birdfont repository Wed, 20 Jan 2016 21:48:50 +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>
Wed, 20 Jan 2016 21:48:50 +0000 (22:48 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 20 Jan 2016 21:48:50 +0000 (22:48 +0100)
commit d5d75084bc4bbd494ff41211ae6bd03667373590
tree 85eccc7c4912cfdc9258f1a78f9b9c2b237a7333
parent 2ed68c3f1a34e77ce28e681d3e6194d53cad1b35
Fix curve handles in SVG parser

libbirdfont/SvgParser.vala
--- a/libbirdfont/SvgParser.vala +++ b/libbirdfont/SvgParser.vala @@ -1914,6 +1914,8 @@ if (b[i -1].type == 'L' || first_point) { // ep.get_left_handle ().set_point_type (PointType.LINE_CUBIC); + } else { + ep.get_left_handle ().set_point_type (PointType.CUBIC); } if (b[i + 1].type == 'C' || b[i + 1].type == 'S') { @@ -1959,9 +1961,9 @@ } foreach (EditPoint e in smooth_points) { - e.set_point_type (PointType.LINE_DOUBLE_CURVE); - e.get_right_handle ().set_point_type (PointType.LINE_DOUBLE_CURVE); - e.get_left_handle ().set_point_type (PointType.LINE_DOUBLE_CURVE); + e.set_point_type (PointType.LINE_CUBIC); + e.get_right_handle ().set_point_type (PointType.LINE_CUBIC); + e.get_left_handle ().set_point_type (PointType.LINE_CUBIC); } foreach (EditPoint e in smooth_points) { @@ -1971,6 +1973,8 @@ for (int i = 0; i < 3; i++) { foreach (EditPoint e in smooth_points) { e.set_tie_handle (true); + e.get_right_handle ().set_point_type (PointType.CUBIC); + e.get_left_handle ().set_point_type (PointType.CUBIC); e.process_tied_handle (); } }