[gtk+/wip/strength-bar: 1/3] themingbackground: fix drawing for repeating positioned images



commit 8356cea26504430839841ead5646cbcb9440741e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 29 15:35:03 2012 -0400

    themingbackground: fix drawing for repeating positioned images
    
    When a background position is specified, it should be honored by setting
    its coordinates on the rect we fill, instead of translating the source
    surface, since we pass the exact rect coordinates.
    This fixes drawing of backgrounds for patterns that repeat on one
    direction and specify the other by using background-position.

 gtk/gtkthemingbackground.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c
index 9da6abb..e267880 100644
--- a/gtk/gtkthemingbackground.c
+++ b/gtk/gtkthemingbackground.c
@@ -266,14 +266,13 @@ _gtk_theming_background_paint_layer (GtkThemingBackground *bg,
           _gtk_css_image_draw (layer->image, cr2, image_width, image_height);
           cairo_destroy (cr2);
 
-          cairo_set_source_surface (cr, surface,
-                                    _gtk_css_position_value_get_x (pos, width - image_width),
-                                    _gtk_css_position_value_get_y (pos, height - image_height));
+          cairo_set_source_surface (cr, surface, 0, 0);
           cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_REPEAT);
           cairo_surface_destroy (surface);
 
           cairo_rectangle (cr,
-                           0, 0,
+                           _gtk_css_position_value_get_x (pos, width - image_width),
+                           _gtk_css_position_value_get_y (pos, height - image_height),
                            hrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT ? image_width : width,
                            vrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT ? image_height : height);
           cairo_fill (cr);



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