[gtk+] GtkWindow: Fix the down-scaling in icon_from_list()



commit 7ef5858f8de8bf2fa8e0e0dad0e860f81306a368
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Nov 13 12:48:57 2017 +0100

    GtkWindow: Fix the down-scaling in icon_from_list()
    
    Must use floating-point division to get the correct scale factors.
    cairo_set_source_surface() must be called after cairo_scale().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790287

 gtk/gtkwindow.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 01bc34e..0ffd006 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4544,10 +4544,10 @@ icon_from_list (GList *list,
 
   target = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, size, size);
   cr = cairo_create (target);
-  cairo_set_source_surface (cr, source , 0, 0);
   cairo_scale (cr,
-              size / gdk_texture_get_width (texture),
-              size / gdk_texture_get_height (texture));
+              (double) size / gdk_texture_get_width (texture),
+              (double) size / gdk_texture_get_height (texture));
+  cairo_set_source_surface (cr, source, 0, 0);
   cairo_paint (cr);
   cairo_destroy (cr);
   cairo_surface_destroy (source);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]