[gimp/gimp-2-10] app: fix gimp_projection_projectable_bounds_changed()



commit 53afeb11ac93e536483a29e4e0961ad5d28c908b
Author: Ell <ell_se yahoo com>
Date:   Fri Aug 3 21:45:06 2018 -0400

    app: fix gimp_projection_projectable_bounds_changed()
    
    In gimp_projection_projectable_bounds_changed(), which is called by
    GimpProjection in response to a GimpProjectable::bounds-changed
    signal, invalidate all regions of the new projection that weren't
    copied from the old projection, so that they get rendered upon
    flushing, instead of remaining empty.
    
    Additionally, fix preview invalidation -- in particular, don't
    directly invalidate the projectable's preview, even if preview
    invalidation is already queued and chunk rendering was finished by
    the boundary change, and instead always queue a preview
    invalidation.
    
    (cherry picked from commit bb5e3fd9263bfc725e473c8902b8ab4915ed1c57)

 app/core/gimpprojection.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index 8d068e341a..4567b12b88 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -1237,14 +1237,14 @@ gimp_projection_projectable_bounds_changed (GimpProjectable *projectable,
                                 &proj->priv->priority_rect.height);
     }
 
-  if (proj->priv->chunk_render.idle_id)
-    {
-      proj->priv->invalidate_preview = TRUE;
-    }
-  else
-    {
-      proj->priv->invalidate_preview = FALSE;
-
-      gimp_projectable_invalidate_preview (projectable);
-    }
+  if (dx > 0)
+    gimp_projection_add_update_area (proj, 0, 0, dx, h);
+  if (dy > 0)
+    gimp_projection_add_update_area (proj, 0, 0, w, dy);
+  if (dx + old_w < w)
+    gimp_projection_add_update_area (proj, dx + old_w, 0, w - (dx + old_w), h);
+  if (dy + old_h < h)
+    gimp_projection_add_update_area (proj, 0, dy + old_h, w, h - (dy + old_h));
+
+  proj->priv->invalidate_preview = TRUE;
 }


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