The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Draw quadratc paths with Beziér tool

These changes was commited to the Birdfont repository Sun, 31 May 2015 08:00:21 +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>
Sun, 31 May 2015 08:00:21 +0000 (10:00 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 31 May 2015 08:00:21 +0000 (10:00 +0200)
commit 1b774c6db3e739c16a33fd4cfe985ba9e968afbd
tree ab955cfe7e31217812faddff860f5c932c1e4b01
parent 019913b26a4ff54f8ff2c2f86c3c86238f829dbb
Draw quadratc paths with Beziér tool

libbirdfont/BezierTool.vala
libbirdfont/PenTool.vala
--- a/libbirdfont/BezierTool.vala +++ b/libbirdfont/BezierTool.vala @@ -209,8 +209,8 @@ current_point.type = pt; current_point.get_left_handle ().type = pt; current_point.get_right_handle ().type = pt; - current_point.get_left_handle ().convert_to_line (); + current_point.get_right_handle ().convert_to_line (); } @@ -294,6 +294,12 @@ current_path.hide_end_handle = true; current_point.recalculate_linear_handles (); current_path.reset_stroke (); + + if (current_point.type == PointType.QUADRATIC) { + current_path.create_list (); + current_point.get_prev ().get_right_handle ().process_connected_handle (); + } + GlyphCanvas.redraw (); } else if (state == MOVE_HANDLES || state == MOVE_LAST_HANDLE_LEFT
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -1263,13 +1263,17 @@ if (union.get_last_point ().get_left_handle ().is_curve ()) { first_point.get_left_handle ().convert_to_curve (); } else { - first_point.get_left_handle ().convert_to_line (); + if (first_point.type != PointType.QUADRATIC) { + first_point.get_left_handle ().convert_to_line (); + } + } + + if (first_point.type != PointType.QUADRATIC) { + first_point.get_left_handle ().move_to_coordinate_internal ( + union.get_last_point ().get_left_handle ().x, + union.get_last_point ().get_left_handle ().y); } - first_point.get_left_handle ().move_to_coordinate_internal ( - union.get_last_point ().get_left_handle ().x, - union.get_last_point ().get_left_handle ().y); - union.delete_last_point (); union.append_path (merge);