The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – 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
[Wed, 20 Jan 2016 21:48:50 +0000]

Updated Files

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 (); } }