[gimp] gimp_group_layer_update_size(): remove bogus optimization



commit 228da1d32ef093ab7d55e2901f84acc845a60572
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 2 21:37:07 2009 +0200

    gimp_group_layer_update_size(): remove bogus optimization
    
    The optimization here which would change only the group layer's offset
    if the extents of the union of its children has not changed is
    completely bogus. That case can only happen if one of the chldren was
    moved in a way that does not change the extents of all children's
    union, but this doesn't mean that the childrens' positions relative to
    each other have not changed.
    
    Instead, invalidate the entire projection to at least avoid constant
    reallocation of the tile pyramid.
    
    Found by group layer testing hero Tobias Jakobs.
    
    (will have to optimize real translations of the entire group (or of the
    only child in the group) differently)

 app/core/gimpgrouplayer.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index 09d4772..5d5cc38 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -869,6 +869,14 @@ gimp_group_layer_update_size (GimpGroupLayer *group)
       else
         {
           gimp_item_set_offset (item, x, y);
+
+          /*  invalidate the entire projection since the poition of
+           *  the children relative to each other might have changed
+           *  in a way that happens to leave the group's width and
+           *  height the same
+           */
+          gimp_projectable_invalidate (GIMP_PROJECTABLE (group),
+                                       x, y, width, height);
         }
 
       if (group->offset_node)



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