Bug 399337 - Undo not working correctly after Contiguous Selection Tool has been used
Summary: Undo not working correctly after Contiguous Selection Tool has been used
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Selection (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: Eoin O'Neill
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-10-03 13:54 UTC by misuraluv
Modified: 2018-11-20 08:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
1) Faulty Behaviour when using contiguous selection tool (425.37 KB, image/gif)
2018-10-03 13:54 UTC, misuraluv
Details
2) Expected Behaviour when NOT using contiguous selection tool (351.33 KB, image/gif)
2018-10-03 13:56 UTC, misuraluv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misuraluv 2018-10-03 13:54:58 UTC
Created attachment 115379 [details]
1) Faulty Behaviour when using contiguous selection tool

SUMMARY
Using the contiguous selection tool to select something will mess up the undo history and canvas rendering. 

All entries in the the undo history docker still look ok though. But it seems the undo history lags behind after having used the contiguous selection tool once. This means you can't undo all changes you made to a file anymore. 

It doesn't matter if you undo via ctrl+z or the undo history docker. 
The canvas rendering also seems to halt and bug out until you made another selection with the contiguous selection tool.


STEPS TO REPRODUCE
1. Create a new file or open an existing one.
2. Draw 3 brush strokes.
3. Now use the contiguous selection tool to select anything in the picture.
4. Try to undo all your changes via pressing ctrl+z multiple times


OBSERVED RESULT
Visually no undo or a "glitchy undo"(only a part of a brush stroke is undone) is happening in the canvas. The selected entry in the undo history docker is moving up as expected though. Only after using the contiguous selection tool again to select something the canvas will fully update. But even then, the first brush stroke you made will still be there and not undone.


EXPECTED RESULT
Undo should be visible immediately, without glitches and all changes should be undone. 
The original picture like you created or opened it should be restored.


SOFTWARE VERSIONS
Krita
  Version: 4.1.3 (git 5511f5f)

Qt
  Version (compiled): 5.9.3
  Version (loaded): 5.9.3

OS Information
  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.15063
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
  **OpenGL not initialized**
Comment 1 misuraluv 2018-10-03 13:56:09 UTC
Created attachment 115380 [details]
2) Expected Behaviour when NOT using contiguous selection tool
Comment 2 misuraluv 2018-10-03 20:20:40 UTC
Also was just able to reproduced this on another PC with an older Krita build:

Krita
  Version: 4.1.1

OS Information
  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.17134
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
  **OpenGL not initialized**
Comment 3 Halla Rempt 2018-10-06 18:38:33 UTC
Hi Miruslav,

I can see what happens in your screen recording, but unfortunately I'm still not able to reproduce the issue.
Comment 4 vanyossi 2018-10-06 21:09:06 UTC
I did the same steps as in the video but I also couldn't reproduce the issue
Comment 5 misuraluv 2018-10-07 11:53:56 UTC
Hi, this is really weird. I just downloaded the portable version in case it had something to do with my config and still was able to reproduce it on my desktop pc.

I also tried it on a Surface Pro with Win10 and there I also wasn't able to reproduce the behaviour.
Comment 6 Eoin O'Neill 2018-10-12 19:32:28 UTC
I can reproduce this bug, but it has to be on a single isolated layer it seems. Testing it with only one layers allows this to be reproduced.
Comment 7 Eoin O'Neill 2018-10-13 19:43:50 UTC
Git commit 27bbf168b1a422153093d03d8c68f14923a91c98 by Eoin O'Neill.
Committed on 13/10/2018 at 19:37.
Pushed by eoinoneill into branch 'master'.

Fixed bug where undo after contiguous selection would sometimes
break undo history and image rendering.

M  +0    -2    libs/image/floodfill/kis_scanline_fill.cpp

https://commits.kde.org/krita/27bbf168b1a422153093d03d8c68f14923a91c98
Comment 8 Eoin O'Neill 2018-10-27 19:27:51 UTC
Commit 195d8dfe4c76f6100d3ab02cfa3b47b3f7c3895f has reverted the original fix, reopening this bug.
Comment 9 Halla Rempt 2018-11-20 08:57:58 UTC
Git commit 73e56e2174a377415fac9049960d79273be5a584 by Boudewijn Rempt, on behalf of Eoin O'Neill.
Committed on 20/11/2018 at 08:21.
Pushed by rempt into branch 'krita/4.1'.

Fixed bug where undo after contiguous selection would sometimes
break undo history and image rendering.

M  +0    -2    libs/image/floodfill/kis_scanline_fill.cpp

https://commits.kde.org/krita/73e56e2174a377415fac9049960d79273be5a584