Commit 1e58841
Better guide labels
Changed files (1)
Diff
@@ -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 ();