[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: Need review and testing for 'zoom-pan-testing-kazakov' branch
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2012-09-11 9:08:15
Message-ID: CAEkBSfUprNDbbZZgfwg4zxbU_UtiyAy6Ly9e3N93M2+bQXWbWA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

Hi!<br><br>The reason why Krita doesn&#39;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.<br> <br>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&#39;m not sure about which scale is \
currently used by the rullers, but they seem to track the mouse pointer right.<br> \
<br>About the future of documentOrigin(). Well, speaking truly, we still need a kind \
of &quot;origin&quot; 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 &quot;preferred center&quot; and \
&quot;offset&quot; [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. <br> <br>[1] - see \
KoCanvasControllerWidget::updateCanvasOffsetX/Y, \
KoCanvasControllerWidget::recenterPreferred() and several others. <br><br><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">

If not, what would be the proper way now to fix<br>
KisZoomManager::mousePositionChanged(), where does one get the offset of the<br>
document in the canvas?<br clear="all"></blockquote></div><br>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.<br> \
<br>-- <br>Dmitry Kazakov<br>



_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic