From f727e885cdb76f0fda24f2f38f1373f37adc8eec Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Wed, 6 Dec 2017 19:39:41 +0100 Subject: [PATCH] Bug 787663 - Cage tool creates artifacts with multi-threading Stop recursion only when all 3 vertices of the triangle are outside the roi (left/right or above/below). --- app/operations/gimpoperationcagetransform.c | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/operations/gimpoperationcagetransform.c b/app/operations/gimpoperationcagetransform.c index e95198405e..a94e55398d 100644 --- a/app/operations/gimpoperationcagetransform.c +++ b/app/operations/gimpoperationcagetransform.c @@ -383,19 +383,19 @@ gimp_operation_cage_transform_interpolate_source_coords_recurs (GimpOperationCag GeglRectangle rect = { 0, 0, 1, 1 }; gint xmin, xmax, ymin, ymax; - if (p1_d.x > roi->x + roi->width) return; - if (p2_d.x > roi->x + roi->width) return; - if (p3_d.x > roi->x + roi->width) return; - if (p1_d.y > roi->y + roi->height) return; - if (p2_d.y > roi->y + roi->height) return; - if (p3_d.y > roi->y + roi->height) return; + if (p1_d.x >= roi->x + roi->width && + p2_d.x >= roi->x + roi->width && + p3_d.x >= roi->x + roi->width) return; + if (p1_d.y >= roi->y + roi->height && + p2_d.y >= roi->y + roi->height && + p3_d.y >= roi->y + roi->height) return; - if (p1_d.x <= roi->x) return; - if (p2_d.x <= roi->x) return; - if (p3_d.x <= roi->x) return; - if (p1_d.y <= roi->y) return; - if (p2_d.y <= roi->y) return; - if (p3_d.y <= roi->y) return; + if (p1_d.x < roi->x && + p2_d.x < roi->x && + p3_d.x < roi->x) return; + if (p1_d.y < roi->y && + p2_d.y < roi->y && + p3_d.y < roi->y) return; xmin = xmax = p1_d.x; ymin = ymax = p1_d.y;