Commit 2d01e5ba authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

draw using Cairo.

2007-11-01  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcellrendererdashes.c
	(gimp_cell_renderer_dashes_render): draw using Cairo.


svn path=/trunk/; revision=24035
parent 2fceee5d
2007-11-01 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcellrendererdashes.c
(gimp_cell_renderer_dashes_render): draw using Cairo.
2007-11-01 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/Makefile.am (scripts):
......
......@@ -192,6 +192,7 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
{
GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell);
GtkStateType state;
cairo_t *cr;
gint width;
gint x, y;
......@@ -222,25 +223,27 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
y = cell_area->y + (cell_area->height - DASHES_HEIGHT) / 2;
width = cell_area->width - 2 * cell->xpad;
cr = gdk_cairo_create (GDK_DRAWABLE (window));
gdk_cairo_rectangle (cr, expose_area);
cairo_clip (cr);
for (x = 0; x < width + BLOCK_WIDTH; x += BLOCK_WIDTH)
{
guint index = ((guint) x / BLOCK_WIDTH) % N_SEGMENTS;
if (dashes->segments[index])
{
GdkRectangle rect;
cairo_rectangle (cr,
cell_area->x + cell->xpad + x, y,
MIN (BLOCK_WIDTH, width - x), DASHES_HEIGHT);
rect.x = cell_area->x + cell->xpad + x;
rect.y = y;
rect.width = MIN (BLOCK_WIDTH, width - x);
rect.height = DASHES_HEIGHT;
gdk_rectangle_intersect (&rect, expose_area, &rect);
gdk_draw_rectangle (widget->window,
widget->style->text_gc[state], TRUE,
rect.x, rect.y, rect.width, rect.height);
gdk_cairo_set_source_color (cr, &widget->style->text[state]);
cairo_fill (cr);
}
}
cairo_destroy (cr);
}
GtkCellRenderer *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment