From 086f6bd7728b4266bf385135021cbb24d3292256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Mon, 15 Jul 2019 13:23:16 +0200 Subject: [PATCH] renderer: Only scale by output scale The original eekboard code scaled icons by a factor. That was simplified in c529e9ed9c2f6f4a430b257430d84ef3e9f36fdc but we can do away with it completely and fetch the icons at the right size making them not blurry. --- eek/eek-renderer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eek/eek-renderer.c b/eek/eek-renderer.c index e1f6f76d..1d7585b8 100644 --- a/eek/eek-renderer.c +++ b/eek/eek-renderer.c @@ -504,7 +504,7 @@ render_key (EekRenderer *self, cairo_surface_t *icon_surface = eek_renderer_get_icon_surface (self, eek_symbol_get_icon_name (symbol), - MIN(bounds.width, bounds.height), + SCALE * MIN(bounds.width, bounds.height), scale); if (icon_surface) { gint width = cairo_image_surface_get_width (icon_surface); @@ -512,10 +512,9 @@ render_key (EekRenderer *self, cairo_save (cr); cairo_translate (cr, - (bounds.width - width * SCALE / scale) / 2, - (bounds.height - height * SCALE / scale) / 2); + (bounds.width - width / scale) / 2, + (bounds.height - height / scale) / 2); cairo_rectangle (cr, 0, 0, width, height); - cairo_scale (cr, SCALE, SCALE); cairo_clip (cr); /* Draw the shape of the icon using the foreground color */ cairo_set_source_rgba (cr, foreground.red,