The Birdfont Source Code


All Repositories / birdfont.git / blobdiff – RSS feed

Fix zoom tool on Windows

Changes made to libbirdfont/ZoomTool.vala

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
--- libbirdfont/ZoomTool.vala +++ libbirdfont/ZoomTool.vala @@ -36,17 +36,18 @@ }); press_action.connect((self, b, x, y) => { - if (b == 1 && KeyBindings.modifier != CTRL) { + if (b == 1 && !KeyBindings.has_ctrl () && !KeyBindings.has_shift ()) { zoom_area_begin_x = x; zoom_area_begin_y = y; + Glyph g = MainWindow.get_current_glyph (); + g.zoom_area_is_visible = true; } }); move_action.connect((self, x, y) => { - Glyph g; + Glyph g = MainWindow.get_current_glyph (); - if (zoom_area_begin_x > 0) { - g = MainWindow.get_current_glyph (); + if (g.zoom_area_is_visible) { g.show_zoom_area (zoom_area_begin_x, zoom_area_begin_y, x, y); } }); @@ -54,7 +55,7 @@ release_action.connect((self, b, x, y) => { Glyph g; - if (b == 1 && KeyBindings.modifier != CTRL) { + if (b == 1 && !KeyBindings.has_ctrl () && !KeyBindings.has_shift ()) { store_current_view (); g = MainWindow.get_current_glyph (); @@ -65,6 +66,7 @@ g.set_zoom_from_area (); } + g.zoom_area_is_visible = false; zoom_area_begin_x = -1; zoom_area_begin_y = -1; }