From 1f8a835e400aae42298c5d36d78e30ac77aef2cd Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 29 Sep 2010 23:23:14 +0200 Subject: [PATCH] app: fix GimpCanvasBoundary's extents --- app/display/gimpcanvasboundary.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/display/gimpcanvasboundary.c b/app/display/gimpcanvasboundary.c index 1da42193ac..dc5de477f7 100644 --- a/app/display/gimpcanvasboundary.c +++ b/app/display/gimpcanvasboundary.c @@ -261,17 +261,17 @@ gimp_canvas_boundary_get_extents (GimpCanvasItem *item, gimp_canvas_boundary_transform (item, shell, segs); - x1 = segs[0].x1 - 1; - y1 = segs[0].y1 - 1; - x2 = x1 + 3; - y2 = y1 + 3; + x1 = MIN (segs[0].x1, segs[0].x2) - 1; + y1 = MIN (segs[0].y1, segs[0].y2) - 1; + x2 = MAX (segs[0].x1, segs[0].x2) + 2; + y2 = MAX (segs[0].y1, segs[0].y2) + 2; for (i = 1; i < private->n_segs; i++) { - gint x3 = segs[i].x1 - 1; - gint y3 = segs[i].y1 - 1; - gint x4 = x3 + 3; - gint y4 = y3 + 3; + gint x3 = MIN (segs[i].x1, segs[i].x2) - 1; + gint y3 = MIN (segs[i].y1, segs[i].y2) - 1; + gint x4 = MAX (segs[i].x1, segs[i].x2) + 2; + gint y4 = MAX (segs[i].y1, segs[i].y2) + 2; x1 = MIN (x1, x3); y1 = MIN (y1, y3);