The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – 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
[Sun, 31 May 2015 08:00:21 +0000]

Updated Files

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