The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Redraw less

These changes was commited to the Birdfont repository Sat, 14 Mar 2015 11:25:25 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sat, 14 Mar 2015 11:25:25 +0000]

Updated Files

libbirdfont/MoveTool.vala
libbirdfont/PenTool.vala
libbirdfont/ResizeTool.vala
--- a/libbirdfont/MoveTool.vala +++ b/libbirdfont/MoveTool.vala @@ -98,6 +98,10 @@ double dx = last_x - x; double dy = last_y - y; double p = PenTool.precision; + + if (!move_path) { + return; + } if (move_path && (fabs(dx) > 0 || fabs (dy) > 0)) { moved = true;
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -1342,13 +1342,16 @@ } public static void set_active_edit_point (EditPoint? e, Path path) { + bool redraw; Glyph g = MainWindow.get_current_glyph (); + foreach (var p in g.path_list) { foreach (var ep in p.points) { ep.set_active (false); } } + redraw = active_edit_point != e; active_edit_point = e; active_path = path; @@ -1356,7 +1359,9 @@ ((!)e).set_active (true); } - g.redraw_area (0, 0, g.allocation.width, g.allocation.height); + if (redraw) { + g.redraw_area (0, 0, g.allocation.width, g.allocation.height); + } } PointSelection? get_closest_point (double ex, double ey, out Path? path) {
--- a/libbirdfont/ResizeTool.vala +++ b/libbirdfont/ResizeTool.vala @@ -23,6 +23,8 @@ Path? resized_path = null; double last_resize_y; double last_resize_x; + + bool move_paths = false; ImageSurface? resize_handle; @@ -94,13 +96,15 @@ last_resize_x = x; last_rotate_y = y; - MoveTool.press (b, x, y); + + move_paths = true; }); release_action.connect((self, b, x, y) => { resize_path = false; rotate_path = false; + move_paths = false; DrawingTools.move_tool.release (b, x, y); }); @@ -120,7 +124,10 @@ out selection_box_height); } - GlyphCanvas.redraw (); + if (move_paths) { + GlyphCanvas.redraw (); + } + DrawingTools.move_tool.move (x, y); });