Need review and testing for 'zoom-pan-testing-kazakov' branch

Dmitry Kazakov dimula73 at gmail.com
Tue Sep 11 09:08:15 UTC 2012


Hi!

The reason why Krita doesn't use documentOrigin() is that it supports
canvas rotation and canvas mirroring, and all the calculations are done
indirectly using QTransform objects. More than that, Krita works mostly in
vastScrolling mode (by default), so the origin capabilities were hardly
used.

About the rullers problem. Well, due to the fact that the canvas can be
rotated and mirrored, the real image coordinates cannot be calculated
easily in Krita, so it uses KisCoordinatesConverter now. Of course, the
question is open what kind of coordinates we should show in the rullers.
Actually, I'm not sure about which scale is currently used by the rullers,
but they seem to track the mouse pointer right.

About the future of documentOrigin(). Well, speaking truly, we still need a
kind of "origin" functionality in Krita, and I wrote about it in the last
commit for the zoom-paning branch. We still have small problems with
centering while zooming in Krita in non-vastScrolling modes (which is not
default), but documentOring() in the state which it has now will not work,
because the KoCanvasControllerWidget does not take origin into account when
recalculating "preferred center" and "offset" [1]. The solution for this
might be to completely encapsulate origin() inside the
KoCanvasControllerWidget and to emit only corrected values of the offset to
the clients, but this would involve really drastic changes to this class
and its public interface.

[1] - see KoCanvasControllerWidget::updateCanvasOffsetX/Y,
KoCanvasControllerWidget::recenterPreferred() and several others.

If not, what would be the proper way now to fix
> KisZoomManager::mousePositionChanged(), where does one get the offset of
> the
> document in the canvas?
>

Well, the right way would be to use some of the methods of the
KisCoordinatesConverter, like imageRectInWidgetPixels(), but which one
depends much on what you want to get.

-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20120911/ef822338/attachment.html>


More information about the kimageshop mailing list