Commit b3ff473
Convert control points with zero length handles to lines This solves a problem with the Beziér tool when the designer uses a grid to create paths.
Changed files (5)
modifiedlibbirdfont/BezierTool.valamodifiedlibbirdfont/StrokeTool.valamodifiedlibbirdfont/SvgParser.valamodifiedlibbirdfont/TabBar.valamodifiedlibbirdfont/ZoomBar.vala
Diff
@@ -244,6 +244,7 @@ public class BezierTool : Tool { public void release (int b, int x, int y) { double px, py; Glyph g;+ EditPoint first, last; if (!button_down) { warning ("Discarding event.");@@ -296,6 +297,16 @@ public class BezierTool : Tool { current_path.force_direction (Direction.CLOCKWISE); } + first = current_path.get_first_point ();+ if (first.get_right_handle ().length == 0) {+ first.convert_to_line ();+ }++ last = current_path.get_last_point ();+ if (last.get_left_handle ().length == 0) {+ last.convert_to_line ();+ }+ current_path.reset_stroke (); state = NONE;@@ -395,12 +395,10 @@ public class StrokeTool : GLib.Object { && Path.distance_to_point (ep, lep) < 0.1) { if (Path.distance_to_point (lep, (!) lep.prev) < 0.001) {- // FIXME: DELETE ep.flags &= uint.MAX ^ EditPoint.SPLIT_POINT; continue; } if (Path.distance_to_point (lep, (!) lep.next) < 0.001) {- // FIXME: DELETE ep.flags &= uint.MAX ^ EditPoint.SPLIT_POINT; continue; } @@ -2178,8 +2176,6 @@ public class StrokeTool : GLib.Object { if (task.is_cancelled ()) { return new PathList ();- } else {- print("Task is running\n"); // FIXME: DELETE } return r;@@ -1578,7 +1578,6 @@ public class SvgParser { if (format == SvgFormat.ILLUSTRATOR) { path_list = create_paths_illustrator (bezier_points, bi); } else {- print(d + "\n\n"); // FIXME: DELETE path_list = create_paths_inkscape (bezier_points, bi); } @@ -670,7 +670,6 @@ public class TabBar : GLib.Object { double progress_size = 40 / scale; Text wheel = has_stop_button () ? stop_icon : progress_icon; - print (@"has_stop_button: $(has_stop_button())\n"); if (!has_stop_button ()) { Theme.text_color (wheel, "Text Tab Bar"); } else {@@ -56,10 +56,6 @@ public class ZoomBar : Tool { /** Zoom level from 0 to 1. */ public void set_zoom (double z) { zoom_level = z;- - if (!MenuTab.background_thread) {- //FIXME: DELETE Toolbox.redraw_tool_box ();- } } void set_zoom_from_mouse (double tx) {