Bug 444791 - Abnormal undo function when using the Transform tool
Summary: Abnormal undo function when using the Transform tool
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 5.0.0-beta2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-01 19:27 UTC by thetwo
Modified: 2024-02-28 18:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description thetwo 2021-11-01 19:27:09 UTC
STEPS TO REPRODUCE
1. Draw two strokes with the brush, then click with the Transform tool
2. Use the shortcut key for undo, it takes two times to undo the box of the Transform tool
3. With the "undo history docker" undo, you click on the undo strokes since the Transform operation does not appear. But instead of the stroke disappearing, the outer frame of the Transform tool disappears


EXPECTED RESULT

When using the shortcut keys, we can undo the outer frame of the Transform tool at once
When using "undo history docker", unframe the Transform tool and perform an undo operation (just like  Bezier curve tool)
Comment 1 Tiar 2021-11-01 19:35:11 UTC
Do I assume correctly it doesn't happen this way in Krita 4.x?
Comment 2 thetwo 2021-11-01 19:42:19 UTC
(In reply to Tiar from comment #1)
> Do I assume correctly it doesn't happen this way in Krita 4.x?

I don‘t know......
But it would be better if it was synchronized with the Bezier curve tool, which also does undo operations properly while it is running. In contrast, the undo of the Transform tool is redundant and inconvenient
Comment 3 Ahab Greybeard 2021-11-05 10:30:46 UTC
It's the same behaviour as in 4.4.8.

When the Transform tool bounding box appears, you haven't actually made any changes to the image.
I select a different tool if I want to back out and get rid of the Transform bounding box.

If you do a rotation and don't finalise it, then Ctrl+Z will undo that rotation, leaving the bounding box as it orginally was.
You can do multiple sequential transform actions (without finalising) and use Ctrl+Z to undo them individualy back in sequence.
Then you need two Ctrl+Z presses to remove the bounding box. I think this is useful to let you know, by the lack of change on the first press, that you've reached the end of the undo sequence.
Comment 4 Hologram 2021-12-22 11:03:09 UTC
(In reply to Ahab Greybeard from comment #3)
> It's the same behaviour as in 4.4.8.
> 
> When the Transform tool bounding box appears, you haven't actually made any
> changes to the image.
> I select a different tool if I want to back out and get rid of the Transform
> bounding box.
> 
> If you do a rotation and don't finalise it, then Ctrl+Z will undo that
> rotation, leaving the bounding box as it orginally was.
> You can do multiple sequential transform actions (without finalising) and
> use Ctrl+Z to undo them individualy back in sequence.
> Then you need two Ctrl+Z presses to remove the bounding box. I think this is
> useful to let you know, by the lack of change on the first press, that
> you've reached the end of the undo sequence.

Is that so? I found that if I perform transformation steps, I am not able to undo them individually by using Ctrl+Z. I can exit the tool and undo the transformation as a whole, which basically reverts back to the state before I activated the transform tool. This is in Beta 2.

STEPS TO REPRODUCE
1. Select a portion of an image with the marquee selection tool (rectangular selection)
2. Invoke the transform tool and scale/ rotate the selection
3. Hit ctrl+z a bunch of times

As you can see, it does not actually undo any of what I did with the transform tool active.
Comment 5 Ahab Greybeard 2021-12-22 12:12:04 UTC
This video illustrates it happening (10.6MB .mkv download):
https://www.dropbox.com/s/v6m3xcv18kvmuro/Undo-Transform-Sequence.mkv?dl=1

After the four individual (and not finalised) transform operations, six Ctrl+Z presses were done.
The fifth one had no efect, the sixth one removed the transform bounding box.
Comment 6 Dmitry Kazakov 2023-10-23 15:09:44 UTC
Git commit b7364f3b14ad4d798178f6f922d2d70309b6ece0 by Dmitry Kazakov.
Committed on 23/10/2023 at 17:08.
Pushed by dkazakov into branch 'master'.

Fix extra in-stroke undo step when using Transform and Move tools

M  +12   -6    libs/ui/tool/KisToolChangesTracker.cpp
M  +4    -1    libs/ui/tool/KisToolChangesTracker.h
M  +5    -3    plugins/tools/basictools/kis_tool_move.cc
M  +6    -5    plugins/tools/tool_transform2/kis_tool_transform.cc

https://invent.kde.org/graphics/krita/-/commit/b7364f3b14ad4d798178f6f922d2d70309b6ece0
Comment 7 Dmitry Kazakov 2024-02-28 18:09:39 UTC
Git commit f5657e1c97564dfe811b66e8d8a462454a620bba by Dmitry Kazakov.
Committed on 28/02/2024 at 12:42.
Pushed by dkazakov into branch 'kazakov/for-5.2'.

Fix extra in-stroke undo step when using Transform and Move tools

M  +12   -6    libs/ui/tool/KisToolChangesTracker.cpp
M  +4    -1    libs/ui/tool/KisToolChangesTracker.h
M  +5    -3    plugins/tools/basictools/kis_tool_move.cc
M  +6    -5    plugins/tools/tool_transform2/kis_tool_transform.cc

https://invent.kde.org/graphics/krita/-/commit/f5657e1c97564dfe811b66e8d8a462454a620bba