After the image is rescaled the allowed minimum and maximum zoom doesn't accommodate the new image size. Reproducible: Always Steps to Reproduce: 1. Create a new image with 8000 x 6000 pixels size. 2. Create another image with 800 x 600 size, then rescale it afterwards to 8000 x 6000 Actual Results: The minimum zoom level of second image won't match that of the first, and you probably can't zoom out enough to see the whole image. Expected Results: Minimum zooms levels should be the same.
The problem happens because we calculate the minimum zoom once in KisZoomManager::setup() which is called only once. There is another problem: KoZoomMode::setMinimumZoom() is a static function that works throughout the whole Krita instance. It should be made owned by KoView/KoCanvasBase or something.
But why do we actually set the minimum zoom to something defined by the image size -- this was changed in, but in other application, the minimum is the same percentage no matter what the image size. commit 53e9ce5107a4a8c0fc4eb41e4205fc1c8b3426c8 Author: Dmitry Kazakov <dimula73@gmail.com> Date: Tue Nov 13 15:56:32 2012 +0400 Follows: v2.5.90 Precedes: v2.6.90 Branches: <Expand> Made the zooming steps consistent in Krita 1) Now the wheel and hotkey zooming in Krita is done using KoZoomAction instead of hardcoded code 2) The zoom levels are changed to be in consistency with other applications (checked in Adobe Reader and Adobe Photoshop). Such change was demanded in bug 302775 BUG:302775
The main reason was that the user can open some really huge images that cannot be shown on screen because they need to small zoom level. There was also another point, though I'm not sure how it is related. OpenGL gives artifacts on too small zoom levels because: 1) the number of mipmap levels is limited; 2) the textures should have an overlapping border, which size depends on the number of mipmaps. See KisConfig::textureOverlapBorder()
Right... I'll try and move the minimumzoom to KoZoomAction, that's per canvas, and KoZoomMode::minimum seems only usef from there.
Yes, that should be the best approach :)
Git commit 4d6318b7532f41b8bb5bc643e4acb5f3e7f0c7d4 by Boudewijn Rempt. Committed on 30/01/2015 at 14:11. Pushed by rempt into branch 'calligra/2.9'. M +18 -8 krita/ui/kis_zoom_manager.cc M +1 -0 krita/ui/kis_zoom_manager.h M +66 -14 libs/widgets/KoZoomAction.cpp M +43 -0 libs/widgets/KoZoomAction.h http://commits.kde.org/calligra/4d6318b7532f41b8bb5bc643e4acb5f3e7f0c7d4