Clone in a terminal:
Commit 3f0caad
Johan Mattsson - 2015-09-21T17:48:05+00:00
3f0caad98eaf6d9b2a3b2cdbddf300ce416e0e3ejohan.mattsson.m@gmail.com

Fix position of toolbox icons

Changed files (2)

Diff

diff --git a/libbirdfont/Renderer/CachedFont.vala b/libbirdfont/Renderer/CachedFont.valaindex 4f2a095..6f357b5 100644--- a/libbirdfont/Renderer/CachedFont.vala+++ b/libbirdfont/Renderer/CachedFont.vala@@ -64,13 +64,18 @@ public class CachedFont : GLib.Object { 	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 @@ public class CachedFont : GLib.Object { 				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;diff --git a/libbirdfont/Tool.vala b/libbirdfont/Tool.valaindex 5ed886e..284b3f9 100644--- a/libbirdfont/Tool.vala+++ b/libbirdfont/Tool.vala@@ -340,7 +340,7 @@ public class Tool : Widget { 		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) {

Contact

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