Bug 503201 - Layer order is reversed during transforming multiple layers
Summary: Layer order is reversed during transforming multiple layers
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (other bugs)
Version First Reported In: 5.2.9
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-22 23:21 UTC by acc4commissions
Modified: 2025-04-23 15:49 UTC (History)
1 user (show)

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


Attachments
transform_layer_order_explanation_002 (49.20 KB, image/jpeg)
2025-04-22 23:21 UTC, acc4commissions
Details

Note You need to log in before you can comment on or make changes to this bug.
Description acc4commissions 2025-04-22 23:21:32 UTC
Created attachment 180547 [details]
transform_layer_order_explanation_002

SUMMARY
Layer order is reversed during transforming multiple layers. (Check the attached image)

It's been this way forever.

STEPS TO REPRODUCE
1. Stack multiple layers
2. Select them at once in the Layers docker
3. Try to transform it (Activate the transformation)

OBSERVED RESULT
The layer order is temporarily reversed, changing how the painting looks on the canvas.

EXPECTED RESULT
It shouldn't change.

SOFTWARE/OS VERSIONS
Windows: Win10
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 acc4commissions 2025-04-22 23:29:40 UTC
It doesn't happen when transforming a group layer. It only happens when selecting multiple layers → transforming them. (It doesn't matter if the layers are stacked together or in between; the selected layer's order is reversed during transformation.)
Comment 2 Dmitry Kazakov 2025-04-23 07:47:27 UTC
Hi, acc4commissions!

Could you check if you have "Fast" preview mode enabled? Does the problem goes away if you activate "Accurate" or "Accurate with Instant Preview"?
Comment 3 acc4commissions 2025-04-23 08:58:26 UTC
(In reply to Dmitry Kazakov from comment #2)
> Hi, acc4commissions!
> 
> Could you check if you have "Fast" preview mode enabled? Does the problem
> goes away if you activate "Accurate" or "Accurate with Instant Preview"?

Yup, it doesn't happen with the Accurate preview mode. But I can't use Accurate mode because liquify is too slow with it..
Comment 4 Dmitry Kazakov 2025-04-23 11:43:39 UTC
Git commit 562845f3223c6a00d8273556d89a0f20a44c665d by Dmitry Kazakov.
Committed on 23/04/2025 at 11:43.
Pushed by dkazakov into branch 'master'.

Fix Transform Tool to show reordered layers preview in Fast mode

Obviosly, we should create a preview of layers in their rendering order,
not in the order the user selected them.

M  +22   -0    libs/image/kis_layer_utils.cpp
M  +1    -0    libs/image/kis_layer_utils.h
M  +0    -24   plugins/tools/tool_transform2/kis_tool_transform.cc
M  +0    -1    plugins/tools/tool_transform2/kis_tool_transform.h
M  +1    -0    plugins/tools/tool_transform2/kis_transform_utils.cpp
M  +2    -2    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/-/commit/562845f3223c6a00d8273556d89a0f20a44c665d
Comment 5 Dmitry Kazakov 2025-04-23 11:45:22 UTC
Git commit 7423f4bcd627a20734759aa15dd1ca566e012147 by Dmitry Kazakov.
Committed on 23/04/2025 at 11:45.
Pushed by dkazakov into branch 'krita/5.2'.

Fix Transform Tool to show reordered layers preview in Fast mode

Obviosly, we should create a preview of layers in their rendering order,
not in the order the user selected them.

M  +22   -0    libs/image/kis_layer_utils.cpp
M  +1    -0    libs/image/kis_layer_utils.h
M  +0    -24   plugins/tools/tool_transform2/kis_tool_transform.cc
M  +0    -1    plugins/tools/tool_transform2/kis_tool_transform.h
M  +1    -0    plugins/tools/tool_transform2/kis_transform_utils.cpp
M  +2    -2    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/-/commit/7423f4bcd627a20734759aa15dd1ca566e012147
Comment 6 Dmitry Kazakov 2025-04-23 11:46:44 UTC
Hi, acc4commissions!

Thank you for the quick reply! I think I have fixed the bug now! :) Please check the result either in tomorrow's nightlies or in this pipeline: https://invent.kde.org/graphics/krita/-/pipelines/936593
Comment 7 acc4commissions 2025-04-23 15:24:40 UTC
(In reply to Dmitry Kazakov from comment #6)
> Hi, acc4commissions!
> 
> Thank you for the quick reply! I think I have fixed the bug now! :) Please
> check the result either in tomorrow's nightlies or in this pipeline:
> https://invent.kde.org/graphics/krita/-/pipelines/936593

Thanks for the quick fix! Is it pushed in the Next build or Plus build or both?
Comment 8 acc4commissions 2025-04-23 15:49:48 UTC
Nvm, I saw the 5.2 label. :>