Bug 423830 - Horizontal and Vertical Mirror tools have initial placement problems with more than one open image
Summary: Horizontal and Vertical Mirror tools have initial placement problems with mor...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Debian stable Linux
: NOR minor
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
: 440626 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-03 08:50 UTC by Ahab Greybeard
Modified: 2022-06-03 13:24 UTC (History)
2 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 Ahab Greybeard 2020-07-03 08:50:28 UTC
SUMMARY
This happens in all appimages from 4.2.0 onwards

STEPS TO REPRODUCE
1. Create a new image and turn on a horizintal mirror and/or a vertical mirror.
NOTE that the mirror lines and handles are conveniently placed on the canvas.
2. Create an additional new image and turn on the mirror lines.
NOTE that the new mirror lines are on the edge of the canvas and that the handles may be very off-canvas depending on zoom level and the fit of the canvas on the workspace.
3. Turn off all mirror lines in both images.
4. Create an additional new image and turn on the mirror lines.
NOTE that the mirror lines and handles are conveniently placed on the canvas.

OBSERVED RESULT
If any open image has one or both mirror lines turned on, a newly created image will have badly placed new mirror lines.
An alternative to Step 1. is to open a .kra file which has mirror lines turned on.
It doesn't matter if the existing mirror lines are visible or locked or not as long as they are turned on.

EXPECTED RESULT
The mirror lines and handles of newly turned on mirror lines should be on the canvas in a 'reasonable' location.
Comment 1 Tiar 2021-08-09 16:01:19 UTC
*** Bug 440626 has been marked as a duplicate of this bug. ***
Comment 2 Lynx3d 2022-06-03 13:24:36 UTC
Git commit 2eca9c48fd3acf94b9b09430f0ecd33a1551c339 by Mathias Wein.
Committed on 03/06/2022 at 13:11.
Pushed by mwein into branch 'master'.

Fix initial mirror axis positions

There is some redundancy with KisImage storing the relative position
of mirror axes (required by resource snapshots, but why relative?),
and KisDocument the absolute positions as part of the display settings.
Their default initializaion did not match though.

Creating/opening another document with default mirror settings while
another document was open would either pick the default initialized
absolute or relative position, depending on whether the current settings
are default or not.

Now KisDocument properly initializes its mirror config, and is also
responsible for keeping the image property in sync.

M  +8    -0    libs/ui/KisDocument.cpp
M  +10   -10   libs/ui/canvas/KisMirrorAxisConfig.cpp
M  +10   -10   libs/ui/canvas/KisMirrorAxisConfig.h
M  +4    -10   libs/ui/canvas/kis_mirror_axis.cpp

https://invent.kde.org/graphics/krita/commit/2eca9c48fd3acf94b9b09430f0ecd33a1551c339