Clone in a terminal:
Commit 1e58841
Johan Mattsson - 2015-03-08T17:16:58+00:00
1e58841ef0ee672365dde34e3c2ef17960e693e9johan.mattsson.m@gmail.com

Better guide labels

Changed files (1)

Diff

diff --git a/libbirdfont/Line.vala b/libbirdfont/Line.valaindex bddb0ff..3f2afbe 100644--- a/libbirdfont/Line.vala+++ b/libbirdfont/Line.vala@@ -290,6 +290,7 @@ public class Line : GLib.Object { 		double p, h, w; 		double size = (active) ? 8 : 5; 		Text glyph_metrics;+		Text line_label; 		 		if (!visible) { 			return;@@ -356,19 +357,26 @@ public class Line : GLib.Object { 		 		// Label 		if (get_active ()) { +			line_label = new Text (get_label (), 19 * MainWindow.units);+ 			if (is_vertical ()) {-				h = g.allocation.height;-				cr.move_to (p + 8 , h - 30);+				line_label.widget_x = p + 8 * MainWindow.units;+				line_label.widget_y = allocation.height - 55 * MainWindow.units; 			} else {-				w = g.allocation.width;-				cr.move_to (w - 70, p + 15);+				line_label.widget_x = g.allocation.width +					- 10 * MainWindow.units +					- line_label.get_extent ();+					+				line_label.widget_y = p + 10 * MainWindow.units; 			}--			cr.set_font_size (12);-			cr.select_font_face ("Cantarell", FontSlant.NORMAL, FontWeight.BOLD);-	-			cr.show_text (get_label ());-			cr.stroke ();+			+			if (active) {+				line_label.set_source_rgba (0, 0, 0.3, 1);+			} else {+				line_label.set_source_rgba (r, this.g, b, a);+			}+			+			line_label.draw (cr); 		} 		 		cr.restore ();

Contact

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