Bug 421797 - Zoom ratio goes weird after changing (only) resolution of the document
Summary: Zoom ratio goes weird after changing (only) resolution of the document
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-19 23:33 UTC by acc4commissions
Modified: 2020-05-20 18:07 UTC (History)
2 users (show)

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


Attachments
Screenshot of the button at the bottom-right corner (5.60 KB, image/png)
2020-05-20 08:59 UTC, Dmitry Kazakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description acc4commissions 2020-05-19 23:33:07 UTC
SUMMARY
git 2000148


STEPS TO REPRODUCE
1. Make a document, and check how big Krita shows the canvas at the certain zoom levels.
2. Change the (only) resolution of the document. Preferably, by a drastic amount. 
3. Check the zoom again and compare with the original document.

OBSERVED RESULT

Krita shows canvas very differently zoom-wise. 

You can also check the differences with Text tool.

EXPECTED RESULT

It should be the same.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Dmitry Kazakov 2020-05-20 08:58:42 UTC
Hi, acc4commissions!

Are you sure that you have "Use same aspect as pixels" button checked (it is places at the bottom-right corner of Krita window)?

If this button is unchecked, then Krita's zoom levels try to show the image in "actual physical size".
Comment 2 Dmitry Kazakov 2020-05-20 08:59:11 UTC
Created attachment 128627 [details]
Screenshot of the button at the bottom-right corner
Comment 3 Dmitry Kazakov 2020-05-20 09:06:08 UTC
Changing to NEEDSINFO
Comment 4 Lynx3d 2020-05-20 09:29:31 UTC
After changing the resolution, the zoom values in screen pixels mode is indeed wrong until you toggle the "Use same aspect as pixels" off and back on, so I guess something needs to be updated for the new ppi value to show zoom levels correctly.

Say you change ppi from 300 to 150 (without changing pixel dimension), your image suddenly displays twice as big, toggle the aspect button off and back on and it is back to what it should be.
Comment 5 acc4commissions 2020-05-20 09:34:32 UTC
@DKazakov

1. Thanks! It was checked, but after unchecking it and checking it again Krita returned to what it's supposed to be. Can you make it work without having to re-check the button?

2. The resolution changes how big the vector texts in the same font size are drawn in the canvas. (Texts made before changing the resolution seem stay as they were, but newly created ones are different.) Is this part intentional?
Comment 6 Dmitry Kazakov 2020-05-20 18:06:11 UTC
Git commit b36409a5ad553a66c35a769b8d1363c5f240e0e9 by Dmitry Kazakov.
Committed on 20/05/2020 at 18:06.
Pushed by dkazakov into branch 'master'.

Fix zooming after changing image resolution

We should take zoom-resolution into account when changing
updating visual document size after changing document resolution.

M  +2    -1    libs/ui/KisView.cpp
M  +14   -8    libs/ui/kis_zoom_manager.cc
M  +3    -0    libs/ui/kis_zoom_manager.h

https://invent.kde.org/graphics/krita/commit/b36409a5ad553a66c35a769b8d1363c5f240e0e9
Comment 7 Dmitry Kazakov 2020-05-20 18:07:42 UTC
Git commit 207a9f4e8ca8825592c90ab5caffa5d86b9312b9 by Dmitry Kazakov.
Committed on 20/05/2020 at 18:07.
Pushed by dkazakov into branch 'krita/4.3'.

Fix zooming after changing image resolution

We should take zoom-resolution into account when changing
updating visual document size after changing document resolution.

M  +2    -1    libs/ui/KisView.cpp
M  +14   -8    libs/ui/kis_zoom_manager.cc
M  +3    -0    libs/ui/kis_zoom_manager.h

https://invent.kde.org/graphics/krita/commit/207a9f4e8ca8825592c90ab5caffa5d86b9312b9