[gnome-shell] st-theme-node-drawing: Fix centering when the image needs to be scaled



commit 0ccb2800089822ac200cb20a2bbfddf1c31bbf4b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Oct 2 12:58:19 2011 -0400

    st-theme-node-drawing: Fix centering when the image needs to be scaled
    
    The translate coordinates are calculated as the offset after the scale, so it
    needs to be applied after the scale as well. This fixes random centering issues
    in the UI.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660674

 src/st/st-theme-node-drawing.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index 7513a48..3e7d86f 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -601,8 +601,8 @@ create_cairo_pattern_of_background_image (StThemeNode *node,
           x_offset = - (node->alloc_width / 2. - scaled_width / 2.);
         }
 
-      cairo_matrix_init_translate (&matrix, x_offset, y_offset);
-      cairo_matrix_scale (&matrix, scale_factor, scale_factor);
+      cairo_matrix_init_scale (&matrix, scale_factor, scale_factor);
+      cairo_matrix_translate (&matrix, x_offset, y_offset);
 
       cairo_pattern_set_matrix (pattern, &matrix);
 



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