From bfef6be0fc6a571c6e229ea546a216a662df78f4 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Sun, 23 Apr 2000 20:16:37 +0000 Subject: Calculate the width of the table from the width of all the columns, and 2000-04-23 Iain Holmes * e-table-item.c (eti_bounds): Calculate the width of the table from the width of all the columns, and update the eti->width field as appropiate. (eti_update): Update the bbox. svn path=/trunk/; revision=2572 --- widgets/table/e-table-item.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 0b8c106a27..6c0a05db40 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -139,12 +139,20 @@ eti_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y { double i2c [6]; ArtPoint c1, c2, i1, i2; + int col, width = 0; ETableItem *eti = E_TABLE_ITEM (item); /* Wrong BBox's are the source of redraw nightmares */ - gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (eti), i2c); + for (col = 0; col < eti->cols; col++, x1 = x2){ + ETableCol *ecol = e_table_header_get_column (eti->header, col); + + width += ecol->width; + } + eti->width = width; + gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (eti), i2c); + i1.x = eti->x1; i1.y = eti->y1; i2.x = eti->x1 + eti->width; @@ -188,7 +196,6 @@ eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->update) (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->update)(item, affine, clip_path, flags); - o1.x = item->x1; o1.y = item->y1; o2.x = item->x2; @@ -208,6 +215,8 @@ eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) item->x2, item->y2); eti->needs_redraw = 0; } + gnome_canvas_update_bbox (item, item->x1, item->y1, + item->x2, item->y2); } /* -- cgit