static void
gnome_canvas_simpleline_destroy (GtkObject *object)
{
- GnomeCanvasSimpleLine *line;
-
g_return_if_fail (object != NULL);
g_return_if_fail (GNOME_IS_CANVAS_SIMPLELINE (object));
- line = GNOME_CANVAS_SIMPLELINE (object);
-
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
case PROP_Y1:
d = g_value_get_double (value);
if (simpleline->y1 != d) {
- simpleline->y1 = d;
+ simpleline->y1 = d;
bounds_changed = TRUE;
}
break;
/* get current bounding box in parent-relative world coordinates */
- gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2);
+ gnome_canvas_simpleline_bounds (item, &x1, &y1, &x2, &y2);
/* convert parent-relative item coordinates to world coordinates */
gnome_canvas_item_i2w (item, &x1, &y1);
gnome_canvas_item_i2w (item, &x2, &y2);
- /* reset item bounding box (canvas coordinates, so integral. but stored in doubles) */
-
- gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x1, y1, &item->x1, &item->y1);
- gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x2, y2, &item->x2, &item->y2);
-
/* don't suffer from rounding errors */
- item->x1 = floor (item->x1);
- item->y1 = floor (item->y1);
- item->x2 = ceil (item->x2);
- item->y2 = ceil (item->y2);
+ x1 = floor (x1);
+ y1 = floor (y1);
+ x2 = ceil (x2);
+ y2 = ceil (y2);
/* force non-zero dimensionality for both axes */
- if (item->x1 == item->x2) {
- item->x2 += 1.0;
+ if (x1 == x2) {
+ x2 += 1.0;
}
- if (item->y1 == item->y2) {
- item->y2 += 1.0;
+ if (y1 == y2) {
+ y2 += 1.0;
}
+ /* reset item bounding box (canvas coordinates, so integral. but stored in doubles) */
+
+ gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x1, y1, &item->x1, &item->y1);
+ gnome_canvas_w2c_d (GNOME_CANVAS(item->canvas), x2, y2, &item->x2, &item->y2);
+
/* redraw new location */
gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2);
x1 = simpleline->cx1;
x2 = simpleline->cx2;
y1 = simpleline->cy1;
-
+
if (buf->is_bg) {
gnome_canvas_buf_ensure_buf (buf);
buf->is_bg = FALSE;
}
-
+
if (simpleline->x1 != simpleline->x2) {
PAINT_HORIZA(buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
x1, x2, y1);
y2 = simpleline->cy2;
PAINT_VERTA (buf, simpleline->r, simpleline->g, simpleline->b, simpleline->a,
x1, y1, y2);
-
+
}
}
static void
-gnome_canvas_simpleline_draw (GnomeCanvasItem *item,
- GdkDrawable *drawable,
+gnome_canvas_simpleline_draw (GnomeCanvasItem* canvas,
+ GdkDrawable* drawable,
int x, int y,
int width, int height)
{
- GnomeCanvasSimpleLine *simpleline;
-
- simpleline = GNOME_CANVAS_SIMPLELINE (item);
-
/* XXX not implemented */
}
(void) cx;
(void) cy;
- GnomeCanvasSimpleLine *simpleline;
double x1, y1, x2, y2;
double dx, dy;
- simpleline = GNOME_CANVAS_SIMPLELINE (item);
-
*actual_item = item;
/* Find the bounds for the line */