diff options
author | Benjamin Otte <otte@redhat.com> | 2014-07-02 19:47:48 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2014-07-02 19:48:44 +0200 |
commit | 43788ba936f0f1af4c169bc2c4817e7895efa753 (patch) | |
tree | 1ffd30e795e75a1f843c888a431f02dd14392469 /gtk/gtkcssimageicontheme.c | |
parent | 5fe9ebfe11002c870ebf6a12d3936990ed1aedfa (diff) | |
download | gtk+-43788ba936f0f1af4c169bc2c4817e7895efa753.tar.gz |
cssimageicontheme: Handle scale factors correctly
Code didn't account for the pixbuf returned being scaled.
Diffstat (limited to 'gtk/gtkcssimageicontheme.c')
-rw-r--r-- | gtk/gtkcssimageicontheme.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c index dfc73cdbd2..bfbcb70f57 100644 --- a/gtk/gtkcssimageicontheme.c +++ b/gtk/gtkcssimageicontheme.c @@ -75,10 +75,12 @@ gtk_css_image_icon_theme_draw (GtkCssImage *image, return; } + cairo_translate (cr, width / 2.0, height / 2.0); + cairo_scale (cr, 1.0 / icon_theme->scale, 1.0 / icon_theme->scale); gdk_cairo_set_source_pixbuf (cr, pixbuf, - (width - gdk_pixbuf_get_width (pixbuf)) / 2.0, - (height - gdk_pixbuf_get_height (pixbuf)) / 2.0); + - gdk_pixbuf_get_width (pixbuf) / 2.0, + - gdk_pixbuf_get_height (pixbuf) / 2.0); cairo_paint (cr); g_object_unref (pixbuf); |