gimp r25825 - in trunk: . app/widgets



Author: neo
Date: Tue May 27 09:05:40 2008
New Revision: 25825
URL: http://svn.gnome.org/viewvc/gimp?rev=25825&view=rev

Log:
2008-05-27  Sven Neumann  <sven gimp org>

	* app/widgets/gimpscalebutton.c (gimp_scale_button_image_expose):
	rotated the button graphics and fixed it for 'right-to-left'
	rendering.



Modified:
   trunk/ChangeLog
   trunk/app/widgets/gimpscalebutton.c

Modified: trunk/app/widgets/gimpscalebutton.c
==============================================================================
--- trunk/app/widgets/gimpscalebutton.c	(original)
+++ trunk/app/widgets/gimpscalebutton.c	Tue May 27 09:05:40 2008
@@ -82,15 +82,25 @@
 
   cairo_set_line_width (cr, 0.5);
 
-  cairo_translate (cr,
-                   widget->allocation.x,
-                   widget->allocation.y + widget->allocation.height + 0.5);
-  cairo_scale (cr, 2.0, -2.0);
+  if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
+    {
+      cairo_translate (cr,
+                       widget->allocation.x + widget->allocation.width - 0.5,
+                       widget->allocation.y + widget->allocation.height);
+      cairo_scale (cr, -2.0, -2.0);
+    }
+  else
+    {
+      cairo_translate (cr,
+                       widget->allocation.x + 0.5,
+                       widget->allocation.y + widget->allocation.height);
+      cairo_scale (cr, 2.0, -2.0);
+    }
 
   for (i = 0; i < value; i++)
     {
-      cairo_move_to (cr, 0, i);
-      cairo_line_to (cr, i + 0.5, i);
+      cairo_move_to (cr, i, 0);
+      cairo_line_to (cr, i, i + 0.5);
     }
 
   gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
@@ -98,8 +108,8 @@
 
   for ( ; i < steps; i++)
     {
-      cairo_move_to (cr, 0, i);
-      cairo_line_to (cr, i + 0.5, i);
+      cairo_move_to (cr, i, 0);
+      cairo_line_to (cr, i, i + 0.5);
     }
 
   gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_INSENSITIVE]);



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