[gtk+] rendericon: Fix texture transformation



commit 9455c92b997e44f9632da86d5b78e0c67f147101
Author: Timm Bäder <mail baedert org>
Date:   Wed Oct 11 09:24:35 2017 +0200

    rendericon: Fix texture transformation
    
    Use the one from snapshot_icon, which works.

 gtk/gtkrendericon.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkrendericon.c b/gtk/gtkrendericon.c
index caa7005..e38c2aa 100644
--- a/gtk/gtkrendericon.c
+++ b/gtk/gtkrendericon.c
@@ -314,15 +314,16 @@ gtk_css_style_snapshot_icon_texture (GtkCssStyle *style,
     }
   else
     {
-      graphene_matrix_t translate, matrix;
+      graphene_matrix_t m1, m2, m3;
 
       /* XXX: Implement -gtk-icon-transform-origin instead of hardcoding "50% 50%" here */
-      graphene_matrix_init_translate (&translate, &GRAPHENE_POINT3D_INIT (width / 2.0, height / 2.0, 0));
-      graphene_matrix_multiply (&transform_matrix, &translate, &matrix);
-      graphene_matrix_translate (&matrix, &GRAPHENE_POINT3D_INIT(- width / 2.0, - height / 2.0, 0));
-      graphene_matrix_scale (&matrix, 1.0 / texture_scale, 1.0 / texture_scale, 1);
+      graphene_matrix_init_translate (&m1, &GRAPHENE_POINT3D_INIT (width / 2.0, height / 2.0, 0));
+      graphene_matrix_multiply (&transform_matrix, &m1, &m3);
+      graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0));
+      graphene_matrix_multiply (&m2, &m3, &m1);
+      graphene_matrix_scale (&m1, 1.0 / texture_scale, 1.0 / texture_scale, 1);
 
-      gtk_snapshot_push_transform (snapshot, &matrix, "Icon Transform");
+      gtk_snapshot_push_transform (snapshot, &m1, "Icon Transform");
 
       graphene_rect_init (&bounds, 0, 0, gsk_texture_get_width (texture), gsk_texture_get_height (texture));
       gtk_snapshot_append_texture (snapshot, texture, &bounds, "Icon");


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