summaryrefslogtreecommitdiff
path: root/gtk2_ardour/canvas-simplerect.c
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2006-09-02 02:54:04 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2006-09-02 02:54:04 +0000
commitcb17e3cc81c364ed0ea7f4620d745aefe691386a (patch)
treedba54300f1883f30794c5f706930bfac48e5a470 /gtk2_ardour/canvas-simplerect.c
parent9b578bfff23fccaa97b9d38d12e780a599f39982 (diff)
make autoscroll a bit easier to use, fix missing measure lines when moving the editor pane, slight optimisation(?) of canvas-simplerect (seems to make a difference to me), fix dirty pixels when moving regions across tracks sometimes. some code cleanup.
git-svn-id: svn://localhost/ardour2/trunk@885 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/canvas-simplerect.c')
-rw-r--r--gtk2_ardour/canvas-simplerect.c54
1 files changed, 18 insertions, 36 deletions
diff --git a/gtk2_ardour/canvas-simplerect.c b/gtk2_ardour/canvas-simplerect.c
index abddf5756b..d59096e68b 100644
--- a/gtk2_ardour/canvas-simplerect.c
+++ b/gtk2_ardour/canvas-simplerect.c
@@ -263,7 +263,7 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
GnomeCanvasSimpleRect* simplerect;
double x1, x2, y1, y2;
double old_x1, old_x2, old_y1, old_y2;
- double a, b;
+ double a, b, c, d;
old_x1 = item->x1;
old_y1 = item->y1;
@@ -287,42 +287,24 @@ gnome_canvas_simplerect_reset_bounds (GnomeCanvasItem *item)
gnome_canvas_w2c (GNOME_CANVAS(item->canvas), x2, y2, &simplerect->bbox_lrx, &simplerect->bbox_lry);
/* now queue redraws for changed areas */
-
- if (item->x1 != old_x1) {
-
- /* left edge changed. redraw the area that altered */
a = MIN(item->x1, old_x1);
b = MAX(item->x1, old_x1);
- gnome_canvas_request_redraw (item->canvas, a - 1, item->y1, b + 1, item->y2);
- }
-
- if (item->x2 != old_x2) {
-
- /* right edge changed. redraw the area that altered */
-
- a = MIN(item->x2, old_x2);
- b = MAX(item->x2, old_x2);
- gnome_canvas_request_redraw (item->canvas, a - 1, item->y1, b + 1, item->y2);
- }
-
- if (item->y1 != old_y1) {
-
- /* top edge changed. redraw the area that altered */
-
- a = MIN(item->y1, old_y1);
- b = MAX(item->y1, old_y1);
- gnome_canvas_request_redraw (item->canvas, item->x1, a - 1, item->x2, b + 1);
- }
-
- if (item->y2 != old_y2) {
-
- /* lower edge changed. redraw the area that altered */
-
- a = MIN(item->y2, old_y2);
- b = MAX(item->y2, old_y2);
- gnome_canvas_request_redraw (item->canvas, item->x1, a - 1, item->x2, b + 1);
- }
+
+ a = MIN(a, item->x2);
+ a = MIN(a, old_x2);
+ b = MAX(b, item->x2);
+ b = MAX(b, old_x2);
+
+ c = MIN(item->y1, old_y1);
+ d = MAX(item->y1, old_y1);
+
+ c = MIN(c,item->y2);
+ c = MIN(c, old_y2);
+ d = MAX(d,item->y2);
+ d = MAX(d, old_y2);
+
+ gnome_canvas_request_redraw (item->canvas, a, c, b + 0.5, d + 0.5);
}
/*
@@ -494,8 +476,8 @@ gnome_canvas_simplerect_update (GnomeCanvasItem *item, double *affine, ArtSVP *c
gnome_canvas_request_redraw (item->canvas,
simplerect->bbox_ulx,
simplerect->bbox_uly,
- simplerect->bbox_lrx+1,
- simplerect->bbox_lry+1);
+ simplerect->bbox_lrx+0.5,
+ simplerect->bbox_lry+0.5);
simplerect->full_draw_on_update = FALSE;
}