Bug 331789 - Cropping image makes perpective, ellipse, ruler, spline assistants loose alignment.
Summary: Cropping image makes perpective, ellipse, ruler, spline assistants loose alig...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Assistants (show other bugs)
Version: git master (please specify the git hash!)
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
: 396168 396900 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-06 00:35 UTC by vanyossi
Modified: 2019-09-16 17:34 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vanyossi 2014-03-06 00:35:07 UTC
After setting a nice setup cropping the image makes all assistant shift positions.
They all shift the same amount of space depending on the crop made.

Reproducible: Always

Steps to Reproduce:
1.draw a square
2. draw any assistant to fill the entire space of the square, perspective if great for this.
3. Crop.
4. Undo a crop again to see the shift is different for a different crop.
Actual Results:  
Assistant is now in a different position than the square.

Expected Results:  
Assistant should keep the same coordinates it had in relation to the drawing, not the new canvas.
Comment 1 Dmitry Kazakov 2014-03-11 04:57:14 UTC
This happens not only with cropping, but also with all the transformations we support
Comment 2 Dmitry Kazakov 2014-03-11 05:58:59 UTC
I have an idea how to fix it for all the image transformations, but I need about a day of work to do it.
Comment 3 wolthera 2018-07-27 11:56:06 UTC
*** Bug 396900 has been marked as a duplicate of this bug. ***
Comment 4 Halla Rempt 2019-07-19 11:38:52 UTC
okay... But if you don't set yourself as the assignee when setting the bug to assigned, you will forget about it :-). Dmitry, do you still remember your idea?
Comment 5 Dmitry Kazakov 2019-08-19 17:28:50 UTC
Git commit 67b2738002a3cd50b532af257c368bbe6344199a by Dmitry Kazakov.
Committed on 19/08/2019 at 17:27.
Pushed by dkazakov into branch 'kazakov/transformable-decorations-bug-331789'.

Implement transformation of the Grid when image is transformed

Basically, we implement a fake layer (KisDecorationsWrapperLayer),
which accepts all the transformations and tries to transform decorations
(only grids are implemented atm).

There is a tricky thing: tranformations are undoable, but modifications
to grids are not! Therefore we should be really careful about transforming
grids. We cannot just save their state, like we plan to do for all the
vector objects. Instead, we should apply inverted transformation during
undo operation.

M  +24   -0    libs/global/kis_algebra_2d.h
M  +8    -0    libs/image/kis_layer_utils.h
M  +2    -0    libs/ui/CMakeLists.txt
A  +141  -0    libs/ui/KisDecorationsWrapperLayer.cpp     [License: GPL (v2+)]
A  +69   -0    libs/ui/KisDecorationsWrapperLayer.h     [License: GPL (v2+)]
M  +68   -11   libs/ui/KisDocument.cpp
M  +27   -0    libs/ui/canvas/kis_grid_config.cpp
M  +2    -0    libs/ui/canvas/kis_grid_config.h
M  +6    -3    plugins/dockers/griddocker/grid_config_widget.cpp

https://invent.kde.org/kde/krita/commit/67b2738002a3cd50b532af257c368bbe6344199a
Comment 6 Dmitry Kazakov 2019-08-22 15:43:03 UTC
Git commit 6851976ec93e199f2741b5bc397a36b240c047dc by Dmitry Kazakov.
Committed on 22/08/2019 at 15:13.
Pushed by dkazakov into branch 'kazakov/transformable-decorations-bug-331789'.

Implement transformations for Guides

M  +11   -0    libs/ui/KisDecorationsWrapperLayer.cpp
M  +2    -1    libs/ui/canvas/kis_grid_config.cpp
M  +56   -0    libs/ui/canvas/kis_guides_config.cpp
M  +2    -0    libs/ui/canvas/kis_guides_config.h

https://invent.kde.org/kde/krita/commit/6851976ec93e199f2741b5bc397a36b240c047dc
Comment 7 vanyossi 2019-08-22 18:05:22 UTC
thanks dmitry!
Comment 8 Dmitry Kazakov 2019-08-30 13:12:34 UTC
Fixed in this revision:
https://invent.kde.org/kde/krita/commit/bd00a058145ad0e8c6101bb5adfc6f0f58b29ef9
Comment 9 Dmitry Kazakov 2019-09-16 17:34:50 UTC
*** Bug 396168 has been marked as a duplicate of this bug. ***