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

List:       kde-kimageshop
Subject:    Re: Branch: krita-canvasrotation-silvioheinrich
From:       Dmitry Kazakov <dimula73 () gmail ! com>
Date:       2011-02-07 21:23:36
Message-ID: AANLkTi=nGASYrp+8GhBgD38V57qdvxP28So5oBAOiffn () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> 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

[Attachment #5 (text/html)]

  
          <br>
        <div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt \
0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div \
bgcolor="#ffffff" text="#000000">  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.<br></div></blockquote><div><br>Well, from what i remember about \
flake:<br>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. <br> \
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 ;) .<br><br> 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.<br>  </div><blockquote \
class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, \
204, 204); padding-left: 1ex;"> <div bgcolor="#ffffff" text="#000000">
    
    I wanted to make the zooming with the zoom actions (zooming with +
    &amp; - keys) work like zooming<br>
    with the mose wheel (relative to the mouse \
position).</div></blockquote><div><br>I looked at the Gimp. It zooms around the \
mouse, when it is inside window rect, and zooms around the center otherwise.<br>  \
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: \
1px solid rgb(204, 204, 204); padding-left: 1ex;"> <div bgcolor="#ffffff" \
text="#000000">But it seems  that the KoCanvasControllerWidget handles<br>
    this internally somehow, so i wonder if I can simply switch this
    behavior on somehow for zooming with actions?<br></div></blockquote><div><br>Do \
you mean, you want to override KAction? I&#39;m afraid this may have some \
non-positive consequences. We are quite dependent on flake, so we shouldn&#39;t \
completely ignore it =)<br> <br>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.<br><br>The processing of the zoom action is done KoZoomAction \
class. It is created in the constructor of KoZoomController.<br> </div></div><br><br \
clear="all"><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