fixed drawing routine of the new GimpScaleButton widget

svn path=/trunk/; revision=25806
This commit is contained in:
Sven Neumann 2008-05-26 15:33:25 +00:00
parent b715b2912e
commit dd256b38b0
1 changed files with 8 additions and 6 deletions

View File

@ -65,10 +65,10 @@ gimp_scale_button_image_expose (GtkWidget *widget,
gint steps; gint steps;
gint i; gint i;
adj = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
steps = MIN (widget->allocation.width, widget->allocation.height) / 2; steps = MIN (widget->allocation.width, widget->allocation.height) / 2;
adj = gtk_scale_button_get_adjustment (GTK_SCALE_BUTTON (button));
if (steps < 1) if (steps < 1)
return TRUE; return TRUE;
@ -80,10 +80,12 @@ gimp_scale_button_image_expose (GtkWidget *widget,
gdk_cairo_rectangle (cr, &event->area); gdk_cairo_rectangle (cr, &event->area);
cairo_clip (cr); cairo_clip (cr);
cairo_set_line_width (cr, 1.0); cairo_set_line_width (cr, 0.5);
cairo_translate (cr, widget->allocation.x + 0.5, widget->allocation.y + 0.5); cairo_translate (cr,
cairo_scale (cr, 1.0, -2.0); widget->allocation.x + 0.5,
widget->allocation.y + widget->allocation.height + 0.5);
cairo_scale (cr, 2.0, -2.0);
for (i = 0; i < value; i++) for (i = 0; i < value; i++)
{ {
@ -100,7 +102,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
cairo_line_to (cr, i, i); cairo_line_to (cr, i, i);
} }
gdk_cairo_set_source_color (cr, &widget->style->light[widget->state]); gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_INSENSITIVE]);
cairo_stroke (cr); cairo_stroke (cr);
cairo_destroy (cr); cairo_destroy (cr);