GNOME Bugzilla – Bug 735906
Transform tools give unexpected results when transforming certain sets of linked layers
Last modified: 2015-09-08 21:43:51 UTC
Created attachment 285155 [details] GIMP file which should allow replication of the error by translating a linked layer. I found that it's possible to link a set of layers and layer-groups in such a way that causes some glitches with the transform-tools (move, rotate, scale) when manipulating a single layer within the layer-group. AFAIK layer links have not been overhauled since I got the version I'm using, so this is probably an issue for all versions since the introduction of groupLayer functionality. If someone else could confirm this for versions more recent than 2.8.8 using the attached file, that would be great. If no-one does, I'll try to remember to test it again when I update. ................................................................................ Setup: ................................................................................ A similar setup has already been done for the attached '.XCF'-file for you to test, but if you would like to recreate the conditions for this issue yourself, follow the below instructions Setup. Otherwise, go to straight to Steps. * Create a set of layers and grouplayers in the following arrangement. Below, (X) represents and unlinked layer, and (L) represents a linked layer. __[root image] (X)+--------BIG GROUP (L)+--------+--------LITTLE GROUP (L)+--------+--------+--------LITTLE LAYER ONE (L)+--------+--------+--------LITTLE LAYER TWO (L)+--------+--------+--------LITTLE LAYER THREE So that it's easier to tell what's going on, make sure the non -group-layers have something in them. ................................................................................ Steps: ................................................................................ Once you have downloaded and opened the file described in Setup, or created your own, seeing the glitch is a simple task. * Select a linked layer in the Layers dialog and use a transform tool such as Move to translate/transform the layer. You should quickly notice the behavior. ................................................................................ Issue: ................................................................................ A layer which is linked to the groupLayer which contains it -- along with other layers within the same layer-group -- may not translate as a unit or in the expected manner. Tested on platform: Windows XP SP3 GIMP version: 2.8.8 (may affect other versions?)
I can confirm this on both 2.8.10 and git master on linux.
*** Bug 751230 has been marked as a duplicate of this bug. ***
I started fixing this with a trivial removal of unused code in both branches: commit 5f41d750ec7a24698cda65f91c5f4870b27c7e48 Author: Michael Natterer <mitch@gimp.org> Date: Sat Jun 20 16:03:40 2015 +0200 app: remove "remove_locked" parameter from gimp_image_item_list_filter() This is just removal of unused code before fixing bug 735906. (cherry picked from commit 64b24d169dfb76499e9db0f37d457498c558ac74) app/core/gimpimage-item-list.c | 18 +----------------- app/core/gimpimage-item-list.h | 3 +-- app/core/gimpimage-scale.c | 2 +- app/core/gimpitem-linked.c | 10 +++++----- app/tools/gimpeditselectiontool.c | 18 ++++++------------ 5 files changed, 14 insertions(+), 37 deletions(-) But then realized it's broken in more complex ways. this will need some thinking. Setting 2.8 milestone anyway, let's see...
On top of the wrong handling of the linked list itself, we also had a group layer update problem, so two bugs related to groups. This commit fixes the update problem when several of a group's children change: commit e645b922bfe2d4029243011381c852cbcc9a398f Author: Michael Natterer <mitch@gimp.org> Date: Tue Jun 23 10:24:25 2015 +0200 app: fix update of group layers when size changes only trigger an offset change In gimp_group_layer_update_size(), when the new size happens to be the same as the old size, we need to call gimp_pickable_flush() on the group projection so it is ready to be used for rendering the image, just like in gimp_group_layer_stack_update(). (cherry picked from commit 2f8476bd18ce2b01516133564e894be1d3c4b4c5) app/core/gimpgrouplayer.c | 3 +++ 1 file changed, 3 insertions(+)
This commit is also related: commit afd4602957ae280e7b53187440cd416838bc68ba Author: Michael Natterer <mitch@gimp.org> Date: Sat Jun 20 22:04:03 2015 +0200 app: remove "remove_children" parameter from gimp_image_item_list_filter() It was always TRUE. The function should be renamed now, but not until the merging of linked item fixes to 2-8 is done. (cherry picked from commit 6d6efbbf8b4676a5ac556f9644c0fa755e52a790) app/core/gimpimage-item-list.c | 26 +++++++++++--------------- app/core/gimpimage-item-list.h | 3 +-- app/core/gimpimage-scale.c | 2 +- app/core/gimpitem-linked.c | 10 +++++----- app/tools/gimpeditselectiontool.c | 12 ++++++------ 5 files changed, 24 insertions(+), 29 deletions(-)
Fixed in master and gimp-2-8, for flip, rotate and transform. Move still missing... commit d744c37557a3d4298cb74160c76d037723b9e1ac Author: Michael Natterer <mitch@gimp.org> Date: Thu Jun 25 12:25:41 2015 +0200 Bug 735906 - Transform tools give unexpected results when transforming... ...certain sets of linked layers Fix this bug for flip, rotate and general transforms (not for move yet): gimp_item_linked_flip,rotate,transform(): always transform the passed item too (do not filter it out of the list of items), so these functions do the entire job of transforming a linked group now. Transforming the active item separately didn't work (and is not implementable) if both a layer and its parent layer group were linked. flip tool, transform tool, layer->transform callbacks: don't call gimp_item_foo() *and* (if the item is linked) gimp_item_linked_foo(). Instead call gimp_item_linked_foo() if the item is linked, and gimp_item_foo() otherwise. This commit also kills the mis-feature of transforming the selected pixels of the active layer, and then the linked items completely. We now either only transform the selected area *or* the linked group. (cherry picked from commit 25a696c7f822864ebb35bcbfdb913a98032b0469) app/actions/drawable-commands.c | 26 ++++++-------- app/core/gimpitem-linked.c | 77 ++++++++++++++++++++++++---------------- app/tools/gimpfliptool.c | 15 +++++--- app/tools/gimptransformtool.c | 46 +++++++++++++----------- po/POTFILES.in | 1 + 5 files changed, 92 insertions(+), 73 deletions(-)
Fixed for moving layers from the PDB, and for moving with the cursor keys in the move tool. Moving with the mouse still broken... commit 1a14fed7b5fca05180ec2ace392f6785f08fd0cd Author: Michael Natterer <mitch@gimp.org> Date: Fri Jun 26 12:05:14 2015 +0200 Bug 735906 - Transform tools give unexpected results when transforming... ...certain sets of linked layers Fix for translating layers from the PDB, and with the cursor keys for gimpeditselectiontool. Moving layers with the mouse is still broken. The approach is exactly the same as in 25a696c7. (cherry picked from commit 3c706d00c67d675bdb8c255b3fff88490fde82bc) app/core/gimpitem-linked.c | 17 ++++++++++------- app/pdb/layer-cmds.c | 37 ++++++++++++++++--------------------- app/tools/gimpeditselectiontool.c | 11 +++++++---- tools/pdbgen/pdb/layer.pdb | 37 ++++++++++++++++--------------------- 4 files changed, 49 insertions(+), 53 deletions(-)
This fixes the move tool too: commit b3e0e8327434cc8110e56f85530be100096ab38a Author: Michael Natterer <mitch@gimp.org> Date: Sat Jun 27 12:34:19 2015 +0200 Bug 735906 - Transform tools give unexpected results when transforming... ...certain sets of linked layers Fix the move tool (GimpEditSelectionTool) using the same principle as the other "linked item" features, just a bit more complicated... Never translate the active item and its linked items separately, always translate the entire list at once. The linked logic was distributed across the entire file. Changed the code to prepare lists of items that are translated live (layers and vectors), and items that are translated at the end (channels, masks and the selection). In the motion and button release functions, simply use the prepared lists without any further duplicated checking. Also clean up the stuff a bit, there is more cleanup needed but first the fix... (cherry picked from commit 358f13f5b89249ca9bac4857f3ce37bc454b5929) app/tools/gimpeditselectiontool.c | 348 +++++++++++++++++-------------------- 1 file changed, 155 insertions(+), 193 deletions(-)
*** Bug 676943 has been marked as a duplicate of this bug. ***