From: Johan Mattsson Date: Sun, 13 Dec 2015 18:18:39 +0000 Subject: Fix text alignment to pixel grid X-Git-Url: https://birdfont.org/gitphp-glip/index.php?p=birdfont.git&a=commitdiff&h=f1a33ba5f3d741dd178a134cd3c44e59257afcf7 --- Fix text alignment to pixel grid --- --- a/libbirdfont/Renderer/Text.vala +++ b/libbirdfont/Renderer/Text.vala @@ -13,6 +13,7 @@ */ using Cairo; + using Math; namespace BirdFont { @@ -338,7 +339,7 @@ double s = get_font_scale (); double cache_y = py - s * (cached_font.top_limit - cached_font.base_line); - cr.set_source_surface ((!) cache, (int) px, (int) cache_y); + cr.set_source_surface ((!) cache, (int) rint (px), (int) rint (cache_y)); cr.paint (); }