Commit 0e71984
bugfix: tie to grid
Changed files (4)
modifiedsrc/GlyphCanvas.valamodifiedsrc/GridTool.valamodifiedsrc/GtkInterface.valamodifiedsrc/MainWindow.vala
Diff
@@ -47,14 +47,12 @@ class GlyphCanvas : DrawingArea { bool ug = false; if (allocation.height % 2 != 0) { - warning ("MainWindow.toggle_expanded_margin_bottom ();"); - // MainWindow.toggle_expanded_margin_bottom (); + MainWindow.native_window.toggle_expanded_margin_bottom (); ug = true; } if (allocation.width % 2 != 0) { - warning ("MainWindow.toggle_expanded_margin_right ();"); - // MainWindow.toggle_expanded_margin_right (); + MainWindow.native_window.toggle_expanded_margin_right (); ug = true; } @@ -198,8 +198,8 @@ class GridTool : Tool { } if (!coordinate) {- x = (xmin.get_pos () - g.view_offset_x + (g.allocation.width / 2)) * g.view_zoom; - y = (ymin.get_pos () - g.view_offset_y + (g.allocation.height / 2)) * g.view_zoom;+ x = Glyph.reverse_path_coordinate_x (xmin.get_pos ());+ y = Glyph.reverse_path_coordinate_y (-ymin.get_pos ()); } else { x = xmin.get_pos (); y = ymin.get_pos ();@@ -154,7 +154,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { } - internal static void toggle_expanded_margin_bottom () {+ internal void toggle_expanded_margin_bottom () { int w, h; margin_bottom.get_size_request (out w, out h); @@ -164,7 +164,7 @@ public class GtkWindow : Gtk.Window, NativeWindow { margin_bottom.set_size_request (w, h); } - internal static void toggle_expanded_margin_right () { + internal void toggle_expanded_margin_right () { int w, h; margin_right.get_size_request (out w, out h); @@ -24,6 +24,10 @@ namespace Supplement { public interface NativeWindow : GLib.Object { public abstract string? file_chooser (string title); public abstract string? set_title (string title); + + public abstract void toggle_expanded_margin_bottom (); + public abstract void toggle_expanded_margin_right (); + } internal class MainWindow {