The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix symmetrical handles

These changes was commited to the Birdfont repository Fri, 24 Jun 2016 15:16:37 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Fri, 24 Jun 2016 15:16:37 +0000]

Updated Files

libbirdfont/DrawingTools.vala
libbirdfont/EditPoint.vala
libbirdfont/EditPointHandle.vala
libbirdfont/PenTool.vala
--- a/libbirdfont/DrawingTools.vala +++ b/libbirdfont/DrawingTools.vala @@ -537,7 +537,7 @@ if (!p.path.is_open () || !end_point) { p.point.set_reflective_handles (!symmetrical); - p.point.process_symmetrical_handles (); + p.point.get_right_handle ().process_symmetrical_handle (); if (symmetrical) { ep.point.set_tie_handle (false);
--- a/libbirdfont/EditPoint.vala +++ b/libbirdfont/EditPoint.vala @@ -265,12 +265,6 @@ public void set_tie_handle (bool tie) { tie_handles = tie; - } - - public void process_symmetrical_handles () { - process_tied_handle (); - right_handle.process_symmetrical_handle (); - left_handle.process_symmetrical_handle (); } public void to_curve () {
--- a/libbirdfont/EditPointHandle.vala +++ b/libbirdfont/EditPointHandle.vala @@ -48,7 +48,7 @@ } if (parent.reflective_point) { - parent.process_symmetrical_handles (); + process_symmetrical_handle (); } process_connected_handle (); @@ -75,7 +75,7 @@ } if (parent.reflective_point) { - parent.process_symmetrical_handles (); + process_symmetrical_handle (); } process_connected_handle ();
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -815,7 +815,7 @@ GridTool.tie_coordinate (ref coordinate_x, ref coordinate_y); delta_coordinate_x = coordinate_x - last_point_x; delta_coordinate_y = coordinate_y - last_point_y; - selected_handle.move_to_coordinate (selected_handle.x + delta_coordinate_x, selected_handle.y + delta_coordinate_y); + selected_handle.move_delta_coordinate (delta_coordinate_x, delta_coordinate_y); } else if (GridTool.has_ttf_grid ()) { coordinate_x = Glyph.path_coordinate_x (x); coordinate_y = Glyph.path_coordinate_y (y); @@ -826,8 +826,8 @@ } else { coordinate_x = Glyph.path_coordinate_x (x); coordinate_y = Glyph.path_coordinate_y (y); - selected_handle.x = coordinate_x; - selected_handle.y = coordinate_y; + + selected_handle.move_to_coordinate (coordinate_x, coordinate_y); if (on_axis) { double tied_x = 0; @@ -835,9 +835,8 @@ PointTool.tie_angle (selected_handle.parent.x, selected_handle.parent.y, coordinate_x, coordinate_y, out tied_x, out tied_y); - - selected_handle.x = tied_x; - selected_handle.y = tied_y; + + selected_handle.move_to_coordinate (tied_x, tied_y); } } @@ -1243,7 +1242,7 @@ // alt+click creates a point with symmetrical handles if (KeyBindings.has_alt () || KeyBindings.has_ctrl ()) { selected_point.set_reflective_handles (true); - selected_point.process_symmetrical_handles (); + selected_point.get_right_handle ().process_symmetrical_handle (); GlyphCanvas.redraw (); } }