Branch: krita-canvasrotation-silvioheinrich
Dmitry Kazakov
dimula73 at gmail.com
Mon Feb 7 22:23:36 CET 2011
> Yes I can try to fix it but I think I first need to get a better
> understanding of how all this flake stuff works.
>
Well, from what i remember about flake:
KoCanvasBase is a base object for KisCanvasBase, and this is an interface
that connects the canvas with canvas controller. KoCanvasControllerWidget is
responsible for positioning the KoCanvasBase object onto a particular
widget. In Krita the the role of a destination widget is performed by
KisCanvasWidgetBase.
We derived our own KisCanvasController from KoCanvasControllerWidget class
to override some small methods, but it is not much interesting for zooming,
especially after you removed scrollToCenterPoint() method ;) .
We have KisZoomManager class as well. It is created in KisView. As far as i
remember, its purpose is to retransmit signals and update ruler widgets.
> I wanted to make the zooming with the zoom actions (zooming with + & -
> keys) work like zooming
> with the mose wheel (relative to the mouse position).
>
I looked at the Gimp. It zooms around the mouse, when it is inside window
rect, and zooms around the center otherwise.
> But it seems that the KoCanvasControllerWidget handles
> this internally somehow, so i wonder if I can simply switch this behavior
> on somehow for zooming with actions?
>
Do you mean, you want to override KAction? I'm afraid this may have some
non-positive consequences. We are quite dependent on flake, so we shouldn't
completely ignore it =)
Actually, there is KoCanvasControllerWidget::wheelEvent() method (written by
Sven, iirc) doing exactly what you need. You may try to incorporate it
somehow. Maybe, using KisCanvasController.
The processing of the zoom action is done KoZoomAction class. It is created
in the constructor of KoZoomController.
--
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20110208/3873d89b/attachment.htm
More information about the kimageshop
mailing list