Bug 503611

Summary: Transform Mask get corrupted when the group's content is transformed by Transform Tool
Product: [Applications] krita Reporter: Yu-Hsuan Lai <raincolee>
Component: Layer StackAssignee: Krita Bugs <krita-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.9   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: steps to reproduce

Description Yu-Hsuan Lai 2025-05-01 11:55:52 UTC
Created attachment 180846 [details]
steps to reproduce

SUMMARY
Transform Mask works fine when the group it applies to is the same size or smaller than the canvas. However, it produces incorrect result when the group is larger than the canvas.

STEPS TO REPRODUCE
1. Create an empty file.
2. Create a layer and fill its content so it's the exact same size as the canvas.
3. Put the layer in a group
4. Add a Transform Mask to the group
5. Transform the Transform Mask, for example, scale it down.
6. Select the group, and use Transform Tool to transform the group, for example, scale it up so the content is outside of the canvas
There are some nuances, so please take a look at the attached screen recording.

OBSERVED RESULT
Very corrupted result.

EXPECTED RESULT
Correct result.

ADDITIONAL INFORMATION
This bug only happens when the Transform Mask is applied to a group. It doesn't happen to a simple layer. Note that in step 6 we need to transform the group (not the layer, nor the mask) to trigger this bug.

There was a similar bug here: https://bugs.kde.org/show_bug.cgi?id=427187
But this one only happens with group, so I don't think it's the same bug.

SOFTWARE/OS VERSIONS
Qt
  Version (compiled): 5.15.7
  Version (loaded): 5.15.7

OS Information
  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19045
  Pretty Productname: Windows 10 Version 2009
  Product Type: windows
  Product Version: 10