Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zoom and Pan events #2781

Closed
Kampii opened this issue Feb 10, 2016 · 6 comments
Closed

Zoom and Pan events #2781

Kampii opened this issue Feb 10, 2016 · 6 comments

Comments

@Kampii
Copy link

Kampii commented Feb 10, 2016

How do I monitor these events? The inspector demo did not have that info.

@asturur
Copy link
Member

asturur commented Feb 10, 2016

there is not event for those actions. you get the the zoomToPoint, setZoom, and absolutePan ( if i remember good). If you want to use them with interaction you will bind them to some events. (mouse move, mouse click... )

@Kampii
Copy link
Author

Kampii commented Feb 10, 2016

Thanks! The pan part could be tracked by some "key down" event together with "mouse move" event. However, how would I track the mouse scroll event which zooms in/out?

@StephanBijzitter
Copy link
Contributor

@asturur Is there any reason why these property changes do not trigger events?

I can imagine there will be enormous performance issues when the event handlers are unnecessarily big, but that should not be a concern for fabric as a library.

@asturur
Copy link
Member

asturur commented May 2, 2016

there is no particular reason.
We can add event for setZoom.
We can send the newZoom as parameter considering that zoom can be fired in anyway, so there is no event to send. For panning we have 2 functions ( absolute and relative ) and they can fire event also... But what can they bring as parameter?
Do we send a reference to the canvas that is firing the event?

@asturur
Copy link
Member

asturur commented May 26, 2016

We have events mainly for things we do with mouse or keyboard ( object:added and removed are exceptions).
We do not have a standard way of triggering a zoom or a pan, that is why we do not generate any event.

@asturur
Copy link
Member

asturur commented Sep 19, 2016

Before adding this event i should be sure we do not use setZoom and other stuff internally for processing. i think we do in dataUrl but i can still change that.
Some event like onZoom and onPan would be nice but those would not fire when people change viewport transform manually.

@asturur asturur closed this as completed Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants