[gegl] operations/transform: treat infinite and empty rectangles correctly



commit 784c02c29b7e631487728edd176745555e10fb93
Author: Michael Natterer <mitch gimp org>
Date:   Tue May 24 23:44:10 2016 +0200

    operations/transform: treat infinite and empty rectangles correctly
    
    they don't change no matter what the transform is. Special case them
    in get_required_for_output() and get_invalidated_by_change().
    
    Fixes an obscure bug where invalidations from a source op with an
    infinite plane wouldn't be prppagated across a non-identity transform
    op. This is probably another bug because the infinite plane just
    became a "reall large plane" that still covered everything.

 operations/transform/transform-core.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index a3a823a..b975b29 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -553,6 +553,10 @@ gegl_transform_get_required_for_output (GeglOperation       *op,
 
   requested_rect = *region;
 
+  if (gegl_rectangle_is_empty (&requested_rect) ||
+      gegl_rectangle_is_infinite_plane (&requested_rect))
+    return requested_rect;
+
   gegl_transform_create_composite_matrix (transform, &inverse);
   gegl_matrix3_invert (&inverse);
 
@@ -618,6 +622,10 @@ gegl_transform_get_invalidated_by_change (GeglOperation       *op,
   gint           i;
   GeglRectangle  region = *input_region;
 
+  if (gegl_rectangle_is_empty (&region) ||
+      gegl_rectangle_is_infinite_plane (&region))
+    return region;
+
   /*
    * Why does transform_get_bounding_box NOT propagate the region
    * enlarged by context_rect but transform_get_invalidated_by_change


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]