Bug 436892 - Transform Mask on moved clone layer (i.e. clone arrays) has incorrect bounds
Summary: Transform Mask on moved clone layer (i.e. clone arrays) has incorrect bounds
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
: 423615 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-05-10 20:08 UTC by Tiar
Modified: 2021-05-21 11:00 UTC (History)
2 users (show)

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


Attachments
Test file with rectangle and the clones array (32.51 KB, application/x-krita)
2021-05-10 20:08 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2021-05-10 20:08:51 UTC
Created attachment 138303 [details]
Test file with rectangle and the clones array

SUMMARY
When you use clone array with default offsets and you add a Transform Mask, the bounds of the transformation is incorrect, it looks as if it has grown from one side.

STEPS TO REPRODUCE
1. Open the test file or prepare your own: create a small but tall rectangle on a new layer.
2. Go to Layer -> Split -> Clone Array.
3. Change the Columns number to 4 and Rows to 1.
4. Add a Transform Mask to the clone layer called "Clone 3, 1". Use a Transform Tool on it.

OBSERVED RESULT
The boundary of the transformation starts with the rectangle but is much longer: it looks as if it tried to fit all four rectangles.
Note that if you try to transform(*) "Clone 2, 1" it will be 3x longer, if you try to transform "Clone 1, 1", then it will be 2x longer. 

If you create your own Clone Layer from the Layer with rectangle, if you don't move it before adding the transform mask, it works; but if you first move it, the transformation boundary will be incorrect. So it's not Clones Array's specific issue, but Clone Layers + Transform Mask. 

It makes it much more difficult to work with Clone Layers and Clones Array.

*) make a transform mask and then transform

EXPECTED RESULT
The bounds only contain the rectangle.

SOFTWARE/OS VERSIONS
SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git 3241355)
 Languages: pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.8
  Version (loaded): 5.12.8

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.4.0-58-generic
  Pretty Productname: Linux Mint 20.1
  Product Type: linuxmint
  Product Version: 20.1
  Desktop: X-Cinnamon
Comment 1 Tiar 2021-05-10 20:13:05 UTC
Interestingly, this *is* a regression, but it happened between 4.1.7 and 4.2.0.
Comment 2 Dmitry Kazakov 2021-05-20 11:35:09 UTC
Git commit 884898d4527ca6bad73db1f84db78e47cbad5201 by Dmitry Kazakov.
Committed on 20/05/2021 at 11:34.
Pushed by dkazakov into branch 'master'.

Fix bounding rect when modifying transform mask applied to a clone layer

We included the offset twice by taking parentLayer->projection() into
account.

M  +5    -2    libs/image/kis_transform_mask.cpp

https://invent.kde.org/graphics/krita/commit/884898d4527ca6bad73db1f84db78e47cbad5201
Comment 3 Tiar 2021-05-20 21:25:32 UTC
The bug seems to be fixed; but I've got something very similar, which is when you use Move Tool on a Clone Layer, the boundary is huge too (it will be shown on the same test file). This is not a regression (happens on Krita 4.4.3 too), but it seems relevant. Let me know if I should make a new bug report; I'm not sure if it warrants a new one, or not.
Comment 4 Dmitry Kazakov 2021-05-21 11:00:36 UTC
*** Bug 423615 has been marked as a duplicate of this bug. ***