Commit fee0cec
swap lines updates position
Changed files (3)
Diff
@@ -154,8 +154,6 @@ class GridTool : Tool { { double d, m; - Glyph g = MainWindow.get_current_glyph ();- Line xmin = horizontal.first ().data; Line ymin = vertical.first ().data; @@ -166,11 +164,8 @@ class GridTool : Tool { xpos = new Line ("", 0, Line.VERTICAL); ypos = new Line ("", 0, Line.HORIZONTAL); - xpos.set_move (true);- ypos.set_move (true);- - xpos.move_line_to (x, y, g.allocation);- ypos.move_line_to (x, y, g.allocation);+ xpos.pos = Glyph.path_coordinate_x (x);+ ypos.pos = Glyph.path_coordinate_y (y); } else { xpos = new Line ("", x, Line.VERTICAL); ypos = new Line ("", -y, Line.HORIZONTAL);@@ -147,12 +147,14 @@ public class Line : GLib.Object { redraw_line (); // draw at new position } else {- // FIXME: where does g.allocation.height come from?- pos = Glyph.path_coordinate_y (-y + allocation.height);+ // FIXME: flip back the y axis for lines if (GridTool.is_visible ()) {- GridTool.tie_coordinate (ref ax, ref pos);+ double tpy = Glyph.path_coordinate_y (y);+ GridTool.tie_coordinate (ref ax, ref tpy);+ pos = -tpy;+ } else {+ pos = -Glyph.path_coordinate_y (y); }- redraw_line (); } @@ -213,6 +215,9 @@ public class Line : GLib.Object { set_move (false); pos = ll.prev.data.pos; ll.prev.data.pos += 1 * ivz;+ + ll.data.position_updated (ll.data.pos);+ ll.prev.data.position_updated (ll.prev.data.pos); } } @@ -223,6 +228,9 @@ public class Line : GLib.Object { pos = ll.next.data.pos; ll.next.data.pos -= 1 * ivz; set_move (false);++ ll.data.position_updated (ll.data.pos);+ ll.prev.data.position_updated (ll.prev.data.pos); } } @@ -554,7 +554,7 @@ public class TabBar : GLib.Object { cr.set_source_rgba (0, 0, 0, 1); cr.set_font_size (14);- cr.move_to (8, 18);+ cr.move_to (8, 19); cr.show_text (translate (t.get_label ())); cr.stroke ();