static void
gnome_canvas_rect_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
int x, int y, int width, int height)
{
GnomeCanvasRE *re;
double i2w[6], w2c[6], i2c[6];
int x1, y1, x2, y2;
ArtPoint i1, i2;
ArtPoint c1, c2;
re = GNOME_CANVAS_RE (item);
/* Get canvas pixel coordinates */
gnome_canvas_item_i2w_affine (item, i2w);
gnome_canvas_w2c_affine (item->canvas, w2c);
art_affine_multiply (i2c, i2w, w2c);
i1.x = re->x1;
i1.y = re->y1;
i2.x = re->x2;
i2.y = re->y2;
art_affine_point (&c1, &i1, i2c);
art_affine_point (&c2, &i2, i2c);
x1 = c1.x;
y1 = c1.y;
x2 = c2.x;
y2 = c2.y;
if (re->fill_set) {
if (re->fill_stipple)
gnome_canvas_set_stipple_origin (item->canvas, re->fill_gc);
gdk_draw_rectangle (drawable,
re->fill_gc,
TRUE,
x1 - x,
y1 - y,
x2 - x1 + 1,
y2 - y1 + 1);
}
if (re->outline_set) {
if (re->outline_stipple)
gnome_canvas_set_stipple_origin (item->canvas, re->outline_gc);
gdk_draw_rectangle (drawable,
re->outline_gc,
FALSE,
x1 - x,
y1 - y,
x2 - x1,
y2 - y1);
}
}
|