Bug 485910

Summary: Using the color sampling tool discards remaining undo history
Product: [Applications] krita Reporter: Takiro Ryo <takiro-kde>
Component: ToolsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: major    
Priority: NOR    
Version: 5.2.2   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Takiro Ryo 2024-04-21 17:27:50 UTC
When you working on a file and have some steps in your undo history, then you undo one or more and use the color sampler tool the undo history gets reset to that point, making it impossible to use the redo function although nothing happened that should prevent a redo.


STEPS TO REPRODUCE
1.  Open a new Document
2. Optional: open the undo history docker to better see the issue
3. Draw a few strokes to populate the undo history
4. Undo one ore more Steps
5. Use the color sampler and pick a color from the canvas
6. Observe in the undo history how all the steps that ware undone are now gone

OBSERVED RESULT

The Undo history gets reset to the current point and it's not possible to redo anymore.

EXPECTED RESULT

The undo history should stay the same since no change has been made to the document that justifies discarding the steps on the undo stack. You should still be able to redo after just sampling a color from the canvas. sampling a color should not interact with the undo history at all. 

Tested it on the 5.2.2 AppImage version and it affects other users too
https://krita-artists.org/t/eye-dropper-tool-destroys-redo-history/89751
Comment 1 Dmitry Kazakov 2024-04-29 09:11:28 UTC
Git commit cd304142779b62845a7a136ba743bdf583c8bc92 by Dmitry Kazakov.
Committed on 29/04/2024 at 09:11.
Pushed by dkazakov into branch 'master'.

Don't reset redo when doing color picking

M  +1    -0    libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/-/commit/cd304142779b62845a7a136ba743bdf583c8bc92
Comment 2 Dmitry Kazakov 2024-04-29 09:11:56 UTC
Git commit 5acd76f57b777591f0b2895f4ab95bdc86d09b95 by Dmitry Kazakov.
Committed on 29/04/2024 at 09:11.
Pushed by dkazakov into branch 'krita/5.2'.

Don't reset redo when doing color picking


(cherry picked from commit cd304142779b62845a7a136ba743bdf583c8bc92)

0b7bc5ce Don't reset redo when doing color picking

M  +1    -0    libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/-/commit/5acd76f57b777591f0b2895f4ab95bdc86d09b95