The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

HiDPI support on Linux

These changes was commited to the Birdfont repository Tue, 22 Sep 2015 21:42: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
[Tue, 22 Sep 2015 21:42:58 +0000]

Updated Files

birdfont/GtkWindow.vala
libbirdfont/OverViewItem.vala
--- a/birdfont/GtkWindow.vala +++ b/birdfont/GtkWindow.vala @@ -601,6 +601,17 @@ } public double get_screen_scale () { + string? scale = Environment.get_variable ("GDK_SCALE"); + double factor; + + if (scale == null) { + return 1; + } + + if (double.try_parse ((!) scale, out factor)) { + return factor; + } + return 1; } }
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -283,7 +283,7 @@ Surface cache; // unselected item - cache = Screen.create_background_surface ((int) width, 20); + cache = Screen.create_background_surface ((int) width + 1, 20); cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); @@ -302,7 +302,7 @@ label_background = (!) cache; // selected item - cache = Screen.create_background_surface ((int) width, 20); + cache = Screen.create_background_surface ((int) width + 1, 20); cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); @@ -336,10 +336,10 @@ label_background_no_menu = (!) cache; // selected item - cache = Screen.create_background_surface ((int) width, 20); + cache = Screen.create_background_surface ((int) width + 1, 20); cc = new Context (cache); cc.scale(Screen.get_scale(), Screen.get_scale()); - cc.rectangle (0, 0, width - 1, 20 - 1); + cc.rectangle (0, 0, width, 20 - 1); Theme.color (cc, "Selected Overview Item"); cc.fill ();