From 15bb34de076ed130f3277cdcc600616f29cfbb5a Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 27 May 2008 09:05:40 +0000 Subject: [PATCH] rotated the button graphics and fixed it for 'right-to-left' rendering. 2008-05-27 Sven Neumann * app/widgets/gimpscalebutton.c (gimp_scale_button_image_expose): rotated the button graphics and fixed it for 'right-to-left' rendering. svn path=/trunk/; revision=25825 --- ChangeLog | 6 ++++++ app/widgets/gimpscalebutton.c | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b51b2e929..c09925cedc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-27 Sven Neumann + + * app/widgets/gimpscalebutton.c (gimp_scale_button_image_expose): + rotated the button graphics and fixed it for 'right-to-left' + rendering. + 2008-05-27 Michael Natterer * app/display/gimpdisplayshell-coords.c: revert velocity limit to diff --git a/app/widgets/gimpscalebutton.c b/app/widgets/gimpscalebutton.c index 3118273f7a..1dd384f2ea 100644 --- a/app/widgets/gimpscalebutton.c +++ b/app/widgets/gimpscalebutton.c @@ -82,15 +82,25 @@ gimp_scale_button_image_expose (GtkWidget *widget, 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 @@ gimp_scale_button_image_expose (GtkWidget *widget, 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]);