The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Better guide labels

These changes was commited to the Birdfont repository Sun, 08 Mar 2015 17:16:58 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sun, 08 Mar 2015 17:16:58 +0000]

Updated Files

libbirdfont/Line.vala
--- a/libbirdfont/Line.vala +++ b/libbirdfont/Line.vala @@ -290,6 +290,7 @@ double p, h, w; double size = (active) ? 8 : 5; Text glyph_metrics; + Text line_label; if (!visible) { return; @@ -356,19 +357,26 @@ // 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 ();