[gimp] app: always update full drawable region if it has filters



commit 8be0e646bcff19d46679aab3b74aa5217fd5da42
Author: Ell <ell_se yahoo com>
Date:   Sun Jan 19 20:53:22 2020 +0200

    app: always update full drawable region if it has filters
    
    When a drawable has filters attached, they may influence the area
    affected by drawable updates.  Currently, we ignore that, updating
    the original region regardless.  This can lead to drawable updates
    not affecting the correct regions.  This couldn't be triggered
    until now, but since layer groups can now have a transform op
    attached as a filter, updates to their sublayers -- which can
    happen while the transform tool is active -- run into this problem.
    
    Fix it for now by simply updating the full drawable region when the
    drawable has filters.  This is a very conservative approach -- we
    don't even bother checking if we're only dealing with point
    filters, as this change only influences transformed groups right
    now.  Ultimately, we need to rely on node invalidation to drive
    updates, which takes this into account.

 app/core/gimpdrawable.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 43620b052f..b9270e56cd 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -1102,6 +1102,16 @@ gimp_drawable_update (GimpDrawable *drawable,
 {
   g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
 
+  /* TODO: if the drawable has filters, they may influence the region affected
+   * by the update, but we don't currently handle this.  for now, do the most
+   * conservative thing and simply update the entire drawable.
+   */
+  if (! gimp_container_is_empty (drawable->private->filter_stack))
+    {
+      width  = -1;
+      height = -1;
+    }
+
   if (width < 0)
     {
       GeglRectangle bounding_box;


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