Commit 67ed3d7
Insert new point on path
Changed files (5)
modifiedicons/new_point_on_path.pngmodifiedlibbirdfont/DrawingTools.valamodifiedlibbirdfont/PenTool.valamodifiedlibbirdfont/PointTool.valamodifiedlibbirdfont/Tool.vala
Diff
Binary files a/icons/new_point_on_path.png and b/icons/new_point_on_path.png differ@@ -156,10 +156,13 @@ public class DrawingTools : ToolCollection { }); key_tools.add_tool (undo_tool); - Tool inser_point_on_path_tool = new Tool ("new_point_on_path", t_("Insert new points in path"));+ bool insert_points = false;+ Tool inser_point_on_path_tool = new Tool ("new_point_on_path", t_("Insert new points on path"));+ inser_point_on_path_tool.select_action.connect ((self) => {+ insert_points = !insert_points;+ inser_point_on_path_tool.set_selected (insert_points);+ }); inser_point_on_path_tool.set_persistent (true);- key_tools.add_tool (undo_tool);- key_tools.add_tool (inser_point_on_path_tool); // quadratic Bézier points@@ -136,6 +136,8 @@ public class PenTool : Tool { last_point_x = x; last_point_y = y;+ + move_action (this, x, y); }); double_click_action.connect ((self, b, x, y) => {@@ -430,14 +432,13 @@ public class PenTool : Tool { public void press (int button, int x, int y, bool double_click) { Glyph? g = MainWindow.get_current_glyph (); Glyph glyph = (!) g;+ Toolbox tb = MainWindow.get_toolbox (); return_if_fail (g != null); - if (!BirdFont.android || Toolbox.get_tool ("new_point_on_path").is_selected ()) {- if (double_click) {- glyph.insert_new_point_on_path (x, y);- return;- }+ if ((double_click && !BirdFont.android) || tb.get_tool ("new_point_on_path").is_selected ()) {+ glyph.insert_new_point_on_path (x, y);+ return; } if (button == 1) {@@ -42,7 +42,10 @@ public class PointTool : Tool { double_click_action.connect ((self, b, x, y) => { Tool p = pen ();- p.double_click_action (p, b, x, y);+ + if (!BirdFont.android) {+ p.double_click_action (p, b, x, y);+ } }); release_action.connect ((self, b, x, y) => {@@ -151,7 +151,7 @@ public class Tool : GLib.Object { } } - static void show_tooltip () {+ public static void show_tooltip () { TimeoutSource timer_hide; // hide tooltip label later