The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Lock only horizontal guides

These changes was commited to the Birdfont repository Fri, 26 Jun 2015 18:45:36 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 26 Jun 2015 18:45:36 +0000 (20:45 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 26 Jun 2015 18:45:36 +0000 (20:45 +0200)
commit d58449957c71ab8c0c7755b8f60c47dc70e8d1ea
tree 666278061712edf0b9572f4054da52db9a0ac603
parent 35432e693e5e04c911d00676181831ec567f57ad
Lock only horizontal guides

libbirdfont/Line.vala
--- a/libbirdfont/Line.vala +++ b/libbirdfont/Line.vala @@ -246,24 +246,22 @@ double np = pos; redraw_line (); // clear old position - if (!GridTool.lock_grid) { - if (is_vertical ()) { - pos = Glyph.path_coordinate_x (x); + if (is_vertical ()) { + pos = Glyph.path_coordinate_x (x); - if (GridTool.is_visible ()) { - GridTool.tie_coordinate (ref pos, ref none); - } - redraw_line (); // draw at new position - } else { - pos = Glyph.path_coordinate_y (y); - - if (GridTool.is_visible ()) { - GridTool.tie_coordinate (ref none, ref pos); - } - redraw_line (); + if (GridTool.is_visible ()) { + GridTool.tie_coordinate (ref pos, ref none); } + redraw_line (); // draw at new position + } else if (!GridTool.lock_grid) { + pos = Glyph.path_coordinate_y (y); + + if (GridTool.is_visible ()) { + GridTool.tie_coordinate (ref none, ref pos); + } + redraw_line (); } - + if (Math.fabs (np - pos) > 10) { queue_draw_area (0, 0, g.allocation.width, g.allocation.height); }