[gtk+/wip/blur: 1/7] themingengine: change coordinates for _gtk_theming_engine_paint_spinner



commit 6aec4290855549babfa0d5983fc7c48ebe4be804
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Apr 17 14:58:15 2012 -0400

    themingengine: change coordinates for _gtk_theming_engine_paint_spinner
    
    Instead of assuming the current point is the center of the spinner and
    rotating around it, make it behave like gtk_render_icon(), i.e. the
    current point is at the top-left corner of the desired spinner square.
    
    This is needed for subsequent commits that add blur support to spinner
    shadows.

 gtk/gtkthemingengine.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 1d3bc12..a085dc4 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -2700,6 +2700,8 @@ _gtk_theming_engine_paint_spinner (cairo_t       *cr,
 
   cairo_save (cr);
 
+  cairo_translate (cr, radius, radius);
+
   cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
   cairo_set_line_width (cr, 2.0);
 
@@ -2756,7 +2758,9 @@ render_spinner (GtkThemingEngine *engine,
   gtk_theming_engine_get_color (engine, state, &color);
 
   cairo_save (cr);
-  cairo_translate (cr, x + width / 2, y + height / 2);
+  cairo_translate (cr,
+                   x + (width - (2 * radius)) / 2,
+                   y + (height - (2 * radius)) / 2);
 
   _gtk_css_shadows_value_paint_spinner (_gtk_theming_engine_peek_property (engine, GTK_CSS_PROPERTY_ICON_SHADOW),
                                         cr,



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