[gtk+/wip/baedert/children] image: Snapshot animations at the right coordinates



commit f101894f5bf748439f554fc3b959792989bd8b5f
Author: Timm Bäder <mail baedert org>
Date:   Wed Nov 30 21:53:35 2016 +0100

    image: Snapshot animations at the right coordinates
    
    gtk_snapshot_render_icon will already gtk_snapshot_translate_2d the
    current point, so do that only for the iconhelper case.

 gtk/gtkimage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 4d5e8d7..5be11b8 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1453,7 +1453,6 @@ gtk_image_render_contents (GtkCssGadget *gadget,
 
   x += (width - w) / 2;
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
   if (gtk_image_get_storage_type (image) == GTK_IMAGE_ANIMATION)
     {
       GtkStyleContext *context = gtk_widget_get_style_context (widget);
@@ -1465,9 +1464,10 @@ gtk_image_render_contents (GtkCssGadget *gadget,
     }
   else
     {
+      gtk_snapshot_translate_2d (snapshot, x, y);
       gtk_icon_helper_snapshot (priv->icon_helper, snapshot);
+      gtk_snapshot_translate_2d (snapshot, -x, -y);
     }
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
 
   return FALSE;
 }


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