Bug 386704

Summary: Zoom tool is broken in mirror view
Product: [Applications] krita Reporter: Victor Wåhlström <victor.wahlstrom>
Component: ToolsAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, halla, jesse0x42, tamtamy.tymona
Priority: NOR Keywords: triaged
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Victor Wåhlström 2017-11-10 07:36:24 UTC
This is a subset of bug 365933. The pan version of that bug was fixed. Since we can't tag bugs as partially fixed I'm creating this one to track the remaining zoom bug.

The pan tool was fixed by rewriting it based on screen cursor positioning, as that does not care if the canvas is mirrored or not. The zoom tool is more tied to the canvas and can't use the same solution. Unfortunately the code which does the zooming is unaware of the mirroring feature, so a proper fix will require quite a bit of refactoring.
Comment 1 Tiar 2020-05-11 19:58:41 UTC
Hi Victor, are you going to work on this one? It's been over two years already so maybe we should unassign you.

For anyone reading this: steps to reproduce:
1. draw something with one color in left corner of the canvas
2. mirror the canvas using 'M' shortcut
3. select the Zoom Tool (from the Toolbar)
4. using the Zoom Tool, make a rectangle around the object you've painted
5. see a blank canvas, draw something using a different color
6. zoom out using mouse wheel

EXPECTED: both objects should be in the same location, in 5. instead of blank canvas you should see the object drawn in 1.

ACTUAL: one object is in one corner, the other one is in another corner. Zoom Tool points to the location on the other side of the canvas.
Comment 2 Dmitry Kazakov 2020-06-18 08:38:14 UTC
Since the bug has been abandoned for 2.5 years, I'm going to take it.
Comment 3 Dmitry Kazakov 2020-06-18 20:48:56 UTC
Git commit edd2e5eccde20f9242cbe5c7ed038d183e6c9012 by Dmitry Kazakov.
Committed on 18/06/2020 at 20:48.
Pushed by dkazakov into branch 'krita/4.3'.

Fix KoZoomTool on rotated and mirrored canvas

KoCanvasControllerWidget uses widget coordinates, not the view ones.

M  +5    -5    libs/flake/KoCanvasController.h
M  +5    -6    libs/flake/KoCanvasControllerWidget.cpp
M  +10   -0    libs/flake/KoViewConverter.cpp
M  +2    -0    libs/flake/KoViewConverter.h
M  +8    -2    libs/flake/tools/KoZoomStrategy.cpp
M  +10   -0    libs/ui/canvas/kis_coordinates_converter.cpp
M  +5    -0    libs/ui/canvas/kis_coordinates_converter.h

https://invent.kde.org/graphics/krita/commit/edd2e5eccde20f9242cbe5c7ed038d183e6c9012
Comment 4 Dmitry Kazakov 2020-06-18 20:50:38 UTC
Git commit aa9505a5a29cd44df581a6c2771d0641d5ad8abf by Dmitry Kazakov.
Committed on 18/06/2020 at 20:50.
Pushed by dkazakov into branch 'master'.

Fix KoZoomTool on rotated and mirrored canvas

KoCanvasControllerWidget uses widget coordinates, not the view ones.

M  +5    -5    libs/flake/KoCanvasController.h
M  +5    -6    libs/flake/KoCanvasControllerWidget.cpp
M  +10   -0    libs/flake/KoViewConverter.cpp
M  +2    -0    libs/flake/KoViewConverter.h
M  +8    -2    libs/flake/tools/KoZoomStrategy.cpp
M  +10   -0    libs/ui/canvas/kis_coordinates_converter.cpp
M  +5    -0    libs/ui/canvas/kis_coordinates_converter.h

https://invent.kde.org/graphics/krita/commit/aa9505a5a29cd44df581a6c2771d0641d5ad8abf
Comment 5 Dmitry Kazakov 2020-06-18 20:52:14 UTC
*** Bug 417404 has been marked as a duplicate of this bug. ***