Bug 490998 - Some layers lose relative position when copied to a smaller document
Summary: Some layers lose relative position when copied to a smaller document
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: git master (please specify the git hash!)
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-29 19:57 UTC by Ralek Kolemios
Modified: 2024-09-25 09:14 UTC (History)
1 user (show)

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


Attachments
Test file with problem layers (147.81 KB, application/x-krita)
2024-07-29 19:57 UTC, Ralek Kolemios
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralek Kolemios 2024-07-29 19:57:16 UTC
Created attachment 172112 [details]
Test file with problem layers

I can't seem to recreate this from scratch, but it happened to a large document I was working on. I have whittled away at the file until all that's left is the problem layers, which I've replaced with red and green circles for clarity.

- In the test file attached, the red circle is on the right. The green is on the left.
- Select both layers, copy, then create a new file. Make sure the new file is 3,525 pixels or less tall. Any taller and the bug does not occur. (This is related to the position of the layers in the test doc)
- Paste the layers in the new file. The red is now on the left and the green is on the right. They are also about 3500px further down than expected.

5.3.0-prealpha-0e92a775c0
Comment 1 Tom Hrabchak 2024-07-31 10:57:31 UTC
(In reply to Ralek Kolemios from comment #0)
> Created attachment 172112 [details]
> Test file with problem layers
> 
> I can't seem to recreate this from scratch, but it happened to a large
> document I was working on. I have whittled away at the file until all that's
> left is the problem layers, which I've replaced with red and green circles
> for clarity.
> 
> - In the test file attached, the red circle is on the right. The green is on
> the left.
> - Select both layers, copy, then create a new file. Make sure the new file
> is 3,525 pixels or less tall. Any taller and the bug does not occur. (This
> is related to the position of the layers in the test doc)
> - Paste the layers in the new file. The red is now on the left and the green
> is on the right. They are also about 3500px further down than expected.
> 
> 5.3.0-prealpha-0e92a775c0

Copying and pasting layers to a resized canvas is a little unusual as is, what would the expected or desired behavior be in this case?
Comment 2 Ralek Kolemios 2024-07-31 16:42:23 UTC
I'm indifferent so long as the layers stay in the same position relative to each other. Having to reposition the flat color back in the lineart is an unnecessary pain.
Comment 3 Bug Janitor Service 2024-08-05 23:56:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/2213
Comment 4 Dmitry Kazakov 2024-09-25 09:13:37 UTC
Git commit 04242ff3ea3786619f5f2a55439a65337380d1cb by Dmitry Kazakov, on behalf of Ralek Kolemios.
Committed on 25/09/2024 at 09:12.
Pushed by dkazakov into branch 'master'.

Fix original offsets not being accounted for when copying from another document

M  +7    -1    libs/ui/kis_mimedata.cpp

https://invent.kde.org/graphics/krita/-/commit/04242ff3ea3786619f5f2a55439a65337380d1cb
Comment 5 Dmitry Kazakov 2024-09-25 09:13:42 UTC
Git commit 49f87cf38f910f5ce0ef3307fdc6abf629dede61 by Dmitry Kazakov.
Committed on 25/09/2024 at 09:12.
Pushed by dkazakov into branch 'master'.

Fix group layers not being centered when a group is pasted into new document

M  +3    -5    libs/ui/kis_mimedata.cpp

https://invent.kde.org/graphics/krita/-/commit/49f87cf38f910f5ce0ef3307fdc6abf629dede61
Comment 6 Dmitry Kazakov 2024-09-25 09:14:42 UTC
Git commit c3408dc0ee433c9653467cfbb45b67c306345b72 by Dmitry Kazakov, on behalf of Ralek Kolemios.
Committed on 25/09/2024 at 09:14.
Pushed by dkazakov into branch 'krita/5.2'.

Fix original offsets not being accounted for when copying from another document

M  +7    -1    libs/ui/kis_mimedata.cpp

https://invent.kde.org/graphics/krita/-/commit/c3408dc0ee433c9653467cfbb45b67c306345b72
Comment 7 Dmitry Kazakov 2024-09-25 09:14:51 UTC
Git commit b23211b15342825f48a9992d8728e2676fcbe2c3 by Dmitry Kazakov.
Committed on 25/09/2024 at 09:14.
Pushed by dkazakov into branch 'krita/5.2'.

Fix group layers not being centered when a group is pasted into new document

M  +3    -5    libs/ui/kis_mimedata.cpp

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