mirror of https://github.com/GNOME/gimp.git
libgimpwidgets: port GimpCellRendererToggle drawing to cairo
This commit is contained in:
parent
48b10d57f8
commit
1e48f16113
|
@ -367,18 +367,18 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
|
|||
toggle_rect.height -= style->ythickness * 2;
|
||||
|
||||
if (gdk_rectangle_intersect (&draw_rect, &toggle_rect, &draw_rect))
|
||||
gdk_draw_pixbuf (window,
|
||||
style->black_gc,
|
||||
toggle->pixbuf,
|
||||
/* pixbuf 0, 0 is at toggle_rect.x, toggle_rect.y */
|
||||
draw_rect.x - toggle_rect.x,
|
||||
draw_rect.y - toggle_rect.y,
|
||||
draw_rect.x,
|
||||
draw_rect.y,
|
||||
draw_rect.width,
|
||||
draw_rect.height,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
0, 0);
|
||||
{
|
||||
cairo_t *cr = gdk_cairo_create (window);
|
||||
|
||||
gdk_cairo_rectangle (cr, &draw_rect);
|
||||
cairo_clip (cr);
|
||||
|
||||
gdk_cairo_set_source_pixbuf (cr, toggle->pixbuf,
|
||||
toggle_rect.x, toggle_rect.y);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue