Clone in a terminal:
Commit fee0cec
Johan Mattsson - 2013-07-15T09:51:14+00:00
fee0cec5d8df233286fa2b765f857308d9f779d0johan.mattsson.m@gmail.com

swap lines updates position

Changed files (3)

Diff

diff --git a/libbirdfont/GridTool.vala b/libbirdfont/GridTool.valaindex d3eb420..c620081 100644--- a/libbirdfont/GridTool.vala+++ b/libbirdfont/GridTool.vala@@ -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);diff --git a/libbirdfont/Line.vala b/libbirdfont/Line.valaindex 20f0c5b..d3f7a27 100644--- a/libbirdfont/Line.vala+++ b/libbirdfont/Line.vala@@ -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); 				} 			} 			diff --git a/libbirdfont/TabBar.vala b/libbirdfont/TabBar.valaindex fe92c95..1910f34 100644--- a/libbirdfont/TabBar.vala+++ b/libbirdfont/TabBar.vala@@ -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 (); 			

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112