Bug 453409 - Copy/Cut>Paste outputs empty layer if you do it while transforming
Summary: Copy/Cut>Paste outputs empty layer if you do it while transforming
Status: RESOLVED WORKSFORME
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-05 09:47 UTC by acc4commissions
Modified: 2022-08-05 16:45 UTC (History)
3 users (show)

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


Attachments
video recording transform copy paste bug (954.51 KB, video/mp4)
2022-05-18 17:11 UTC, acc4commissions
Details
Proof it works in current master (including hash) (3.16 MB, video/x-matroska)
2022-05-20 17:05 UTC, amyspark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description acc4commissions 2022-05-05 09:47:03 UTC
SUMMARY
git a792621

It's not just an issue happened in nightly. it has been happening for a long time.


STEPS TO REPRODUCE
1. Draw something on a layer and select an area.
2. Trigger transforming tool by Ctrl+T or whatever works(DO NOT 'APPLY' IT YET!).
3. Ctrl+C or Ctrl+X and paste it.

OBSERVED RESULT
The pasted layer is empty.

EXPECTED RESULT
It should work like a normal copy/cut > paste action.

SOFTWARE/OS VERSIONS
Windows: Win7
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

I suspect this founding is related. > https://krita-artists.org/t/make-it-flawless-to-select-region-copy-cut
Comment 1 acc4commissions 2022-05-05 09:49:57 UTC
Using in-stack preview for transform tool doesn't make a difference in result. Also, when you trigger the transform tool, the layer thumbnail shows the selectetd area (temporarily) empty.
Comment 2 acc4commissions 2022-05-09 05:21:40 UTC
Oddly this doesn't happen in krita stable plus builds. In git 90628dc, the layer thumbnail appears temporarily empty, but the copy/cut>paste still works and doesn't output empty layer.
Comment 3 amyspark 2022-05-09 09:12:11 UTC
Assigning to myself because it sounds like a side effect of my clipboard refactoring
Comment 4 amyspark 2022-05-16 21:07:39 UTC
Cannot reproduce on the exact same hash. Copying and pasting with the transform tool enabled result in a new layer being pasted with the contents of the selection.
Comment 5 acc4commissions 2022-05-18 17:10:52 UTC
(In reply to amyspark from comment #4)
> Cannot reproduce on the exact same hash. Copying and pasting with the
> transform tool enabled result in a new layer being pasted with the contents
> of the selection.

It's still happening in the latest nightly(git 3ae600d) on my side. I'll attach a video recording.
Comment 6 acc4commissions 2022-05-18 17:11:26 UTC
Created attachment 148967 [details]
video recording transform copy paste bug
Comment 7 amyspark 2022-05-18 18:31:15 UTC
Going to assign to myself, as it definitely seems like my paste handling code is being somehow over-strict.

(Resolving will take a while, as I'm putting the finishing touches on the xsimd branch and all my builds are pointing to that branch.)
Comment 8 amyspark 2022-05-20 17:05:33 UTC
Created attachment 149028 [details]
Proof it works in current master (including hash)
Comment 9 amyspark 2022-05-20 17:09:42 UTC
Attaching proof it works in current master, including the hash of the commit.  (See https://invent.kde.org/graphics/krita/-/merge_requests/1452, it has a single commit on top of current master)
Comment 10 sh_zam 2022-05-20 19:14:13 UTC
Hmm, I *can* reproduce the bug but occasionally. I'll add this to my todo list and try to find the outlier variable.
Comment 11 acc4commissions 2022-08-05 16:45:20 UTC
I'm not sure if it's the extension of this bug but recent nightlies outputs nothing when you copy paste something while the transforming is triggered, no matter how fast or slow you do it. 

Additionally if you just select->cut/copy the layer fast enough it outputs nothing without even involving transforming. 

tested in git 69812c0