mirror of https://github.com/GNOME/gimp.git
app: cairo_translate() by allocation.x,y instead of doing that when drawing
This commit is contained in:
parent
1cc27bcef7
commit
756b7310e7
|
@ -285,6 +285,11 @@ gimp_color_frame_expose (GtkWidget *widget,
|
||||||
gtk_widget_get_allocation (frame->color_area, &color_area_allocation);
|
gtk_widget_get_allocation (frame->color_area, &color_area_allocation);
|
||||||
|
|
||||||
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||||
|
gdk_cairo_region (cr, eevent->region);
|
||||||
|
cairo_clip (cr);
|
||||||
|
|
||||||
|
cairo_translate (cr, allocation.x, allocation.y);
|
||||||
|
|
||||||
gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
|
gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
|
||||||
|
|
||||||
g_snprintf (buf, sizeof (buf), "%d", frame->number);
|
g_snprintf (buf, sizeof (buf), "%d", frame->number);
|
||||||
|
@ -303,10 +308,8 @@ gimp_color_frame_expose (GtkWidget *widget,
|
||||||
cairo_scale (cr, scale, scale);
|
cairo_scale (cr, scale, scale);
|
||||||
|
|
||||||
cairo_move_to (cr,
|
cairo_move_to (cr,
|
||||||
(allocation.x +
|
(allocation.width / 2.0) / scale - w / 2.0,
|
||||||
allocation.width / 2.0) / scale - w / 2.0,
|
(allocation.height / 2.0 +
|
||||||
(allocation.y +
|
|
||||||
allocation.height / 2.0 +
|
|
||||||
menu_allocation.height / 2.0 +
|
menu_allocation.height / 2.0 +
|
||||||
color_area_allocation.height / 2.0) / scale - h / 2.0);
|
color_area_allocation.height / 2.0) / scale - h / 2.0);
|
||||||
pango_cairo_show_layout (cr, frame->number_layout);
|
pango_cairo_show_layout (cr, frame->number_layout);
|
||||||
|
|
Loading…
Reference in New Issue