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:47:17 +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:47:17 +0000 (22:47 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Wed, 20 Jan 2016 21:47:17 +0000 (22:47 +0100)
commit 05242db5fc2a0cd0dfbd23097ccddbb820cb037c
tree 5faabbbdd1bff8453860936366716ed81ffae02c
parent 4911275638098f69b20070f361abb647b7cfb5f6
Fix curve handles in SVG parser

libbirdfont/SvgParser.vala
--- a/libbirdfont/SvgParser.vala +++ b/libbirdfont/SvgParser.vala @@ -1940,6 +1940,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') { @@ -1985,9 +1987,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) { @@ -1997,6 +1999,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 (); } }