SUMMARY If you click on empty to undo everything the only strokes that disappear are the latest strokes which number up to what is Stack Size set to. Example: If stack size set to 10, I do 12 strokes, click on empty to clear everything last 10 strokes disappear while the first 2 are left on the canvas. STEPS TO REPRODUCE 1. Go to Settings - Configure Krita - General - Miscellaneous - Undo stack size 2. Set stack size to some number (for example 10) 3. Restart Krita 4. Create a new document 5. Paint more stacks than what you set in point 2 6. Go to Undo history docker, scroll up and click on <empty> OBSERVED RESULT Latest strokes equal to number set in Undo stack size disappear the rest stays on canvas. EXPECTED RESULT Clear canvas (no strokes). SOFTWARE/OS VERSIONS Windows: 10 ADDITIONAL INFORMATION Tested in Krita 4.2.7.1 up to a Krita nightly build (krita-nightly-x64-v4.2.8.2-93-gba88e9315a.zip) in portable versions.
Forgot to mention, if you go step by step (by clicking on undo history) it gets messed up, I can't tell exactly how or why, the undo with empty just start behaving differently. I tried this: stack history set to 10, 12 strokes made, I went 1-by-1 back in undo history by clicking in undo history docker, 2 strokes remain (not clicked on empty yet!) which is expected, then I clicked on empty and out of 2 remaining strokes 1 disappeared and 1 stayed. I tried again, this time both strokes disappeared. As you can see it's difficult to find out what exactly happens in a 1-by-1 case as it's not regular but kind of random (?) while clicking on empty right away gives consistently 2 strokes out of 12. (Btw I tried increasing the stack size to 100, same result as with 10)
re. "Example: If stack size set to 10, I do 12 strokes, click on empty to clear everything last 10 strokes disappear while the first 2 are left on the canvas." This is what I'd expect. You can't undo deeper than the stack size. The first two strokes are no longer recorded on the stack. re. "then I clicked on empty and out of 2 remaining strokes 1 disappeared and 1 stayed. I tried again, this time both strokes disappeared." I haven't seen that behaviour after a couple of tries. If it's a random thing, roughly what percentage of the time have you seen it happening?
(In reply to Ahab Greybeard from comment #2) > re. "Example: If stack size set to 10, I do 12 strokes, click on empty to > clear everything last 10 strokes disappear while the first 2 are left on the > canvas." > > This is what I'd expect. You can't undo deeper than the stack size. The > first two strokes are no longer recorded on the stack. > > re. "then I clicked on empty and out of 2 remaining strokes 1 disappeared > and 1 stayed. I tried again, this time both strokes disappeared." > > I haven't seen that behaviour after a couple of tries. If it's a random > thing, roughly what percentage of the time have you seen it happening? I see, I'd expect the same behaviour Photoshop has with the same function when it returns the document to its initial stage (let's say you save your work, come back to it later, load the doc make changes and even if you go over the undo stack limit you can always come back to the doc before changes quickly in that particular session), that's my bad if that's not how it is meant to work (I think I saw the same functionality in some other programs but definitely my bad). When it comes to the second part, it's really hard to tell how often certainly not often or at least I haven't found a way to replicate it with decent success (and considering during work I have a high number for undo stack noticing if if happens or not mid work is impossible at that point unless it's early with blank canvas), I remember something similar happening a few versions back last year when there was something wrong with undo stack but that as fixed so I'll say we can probably close this or delete this report if you know how (?) because the main part is as you say Krita functionality I failed reaching that point during my research before reporting here and the second half is so random that I don't even know where to properly start. Thank you very much and sorry to take your time on bug testing. :0
<empty> refers to the state of the undo stack, not the document. If you undo actions, they stay on the stack in case you want to redo them, but undone actions are cleared as soon as you perform any action, as can be seen by observing the undo history. The undo stack is not saved with the document, it's only for each document per session. Because of this, the second thing , the random thing that you noticed wouldn't actually matter. If your stack size is set to 100 then if it's actually 100 or 99 is not of practical relevance. You can set it to 101 if you have a definite need for exactly 100 undo actions capability. Setting to Resolved Not A Bug but you can reopen this in the future if this particular behaviour is definite and causes you problems.