Commit 019913b
Fix previous zoom view
Changed files (4)
modifiedlibbirdfont/Allocation.valamodifiedlibbirdfont/Glyph.valamodifiedlibbirdfont/ZoomBar.valamodifiedlibbirdfont/ZoomView.vala
Diff
@@ -38,6 +38,10 @@ public class WidgetAllocation : GLib.Object { w.height = height; return w; }+ + public string to_string () {+ return @"x: $x, y: $y, width: $width, height: $height\n";+ } } }@@ -1388,14 +1388,14 @@ public class Glyph : FontDisplay { } public override void restore_last_view () {- if (zoom_list.size == 0 || zoom_list_index - 1 < 0 || zoom_list.size == 0) {+ if (zoom_list.size == 0 || zoom_list_index - 1 < 0) { return; } zoom_list_index--; ZoomView z = zoom_list.get (zoom_list_index);- + view_offset_x = z.x; view_offset_y = z.y; view_zoom = z.zoom;@@ -45,7 +45,11 @@ public class ZoomBar : Tool { }); panel_release_action.connect ((selected, button, tx, ty) => {+ if (update_zoom) {+ DrawingTools.zoom_tool.store_current_view ();+ } update_zoom = false;+ }); } @@ -26,6 +26,10 @@ class ZoomView : GLib.Object { this.zoom = zoom; this.allocation = allocation; }+ + public string to_string () {+ return @"x: $(x), y: $y, zoom: $zoom\n" + allocation.to_string ();+ } } }