The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Fix position of toolbox icons

These changes was commited to the Birdfont repository Mon, 21 Sep 2015 17:48:05 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Mon, 21 Sep 2015 17:48:05 +0000]

Updated Files

libbirdfont/Renderer/CachedFont.vala
libbirdfont/Tool.vala
--- a/libbirdfont/Renderer/CachedFont.vala +++ b/libbirdfont/Renderer/CachedFont.vala @@ -64,13 +64,18 @@ public Glyph? get_glyph_by_name (string name) { Glyph? g = null; Font f; + Glyph glyph; if (font != null) { f = (!) font; g = f.get_glyph_by_name (name); - g.top_limit = f.top_limit; - g.baseline = f.base_line; - g.bottom_limit = f.bottom_limit; + + if (g != null) { + glyph = (!) g; + glyph.top_limit = f.top_limit; + glyph.baseline = f.base_line; + glyph.bottom_limit = f.bottom_limit; + } } if (g == null && name.char_count () == 1) { @@ -81,9 +86,10 @@ return null; } - g.top_limit = f.top_limit; - g.baseline = f.base_line; - g.bottom_limit = f.bottom_limit; + glyph = (!) g; + glyph.top_limit = f.top_limit; + glyph.baseline = f.base_line; + glyph.bottom_limit = f.bottom_limit; } return g;
--- a/libbirdfont/Tool.vala +++ b/libbirdfont/Tool.vala @@ -340,7 +340,7 @@ cr.stroke (); iconx = bgx + 1 + (w - 1) / 2 - icon_font.get_sidebearing_extent () / 2; - icony = bgy - 1 + (h - 1) / 2 - icon_font.get_height () / 2; + icony = bgy + 1 + (h - 1) / 2 - icon_font.get_height () / 2; if (icon_color == "") { if (!selected) {