[gimp] app: update group layer offset before calling gimp_pickable_flush()



commit 4ded26c4f1df99fe4c7055754a2ccef7743b7a52
Author: Ell <ell_se yahoo com>
Date:   Sat Nov 11 16:53:45 2017 -0500

    app: update group layer offset before calling gimp_pickable_flush()
    
    In gimp_group_layer_update_size(), when the layer's bounds have
    changed, update the group layer's offset before the call to
    gimp_pickable_flush() when reallocating the projection.  Otherwise,
    if the group layer's graph isn't constructed yet, it will get
    constructed during the call to gimp_pickable_flush(), however,
    gimp_group_layer_get_graph() will pick up the old coordinates for
    the offset node.

 app/core/gimpgrouplayer.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index c4a80bd..872de61 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -1312,8 +1312,15 @@ gimp_group_layer_update_size (GimpGroupLayer *group)
       width  != old_width            ||
       height != old_height)
     {
-      /* set the offset first, so the graph is in the right state when
-       * the projection is reallocated, see bug #730550.
+      /* update our offset *before* calling gimp_pickable_flush(), so
+       * that if our graph isn't constructed yet, the offset node picks
+       * up the right coordinates in gimp_group_layer_get_graph().
+       */
+      gimp_item_set_offset (item, x, y);
+
+      /* ... or, if the graph is already constructed, set the offset
+       * node's coordinates first, so the graph is in the right state
+       * when the projection is reallocated, see bug #730550.
        */
       if (private->offset_node)
         gegl_node_set (private->offset_node,
@@ -1351,8 +1358,6 @@ gimp_group_layer_update_size (GimpGroupLayer *group)
         }
       else
         {
-          gimp_item_set_offset (item, x, y);
-
           /*  invalidate the entire projection since the position of
            *  the children relative to each other might have changed
            *  in a way that happens to leave the group's width and


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