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

Get updated scale position after zooming in or out #11

Closed
shaneeza opened this issue Sep 11, 2019 · 4 comments · Fixed by #52
Closed

Get updated scale position after zooming in or out #11

shaneeza opened this issue Sep 11, 2019 · 4 comments · Fixed by #52
Labels
enhancement New feature or request

Comments

@shaneeza
Copy link

I'm currently using

<button
 type='button'
 onClick={(e) => this.onZoomIn(e, scale, zoomIn)} > 
+ 
</button>

and inside of

  onZoomIn = (e, scale, zoomIn) => {
    zoomIn(e);
    console.log(e, scale);
  }

This works fine except the scale that is returned is the old scale value. Is there a way that i can get the updated scale value after zooming in or out?

or

Is there by chance an onChange event or something similar where i can always get updated values when ever any change is made? Currently there is onPanning, onWheel, etc but there is nothing for onZoom.

Thanks

@prc5 prc5 added the enhancement New feature or request label Sep 14, 2019
@prc5
Copy link
Collaborator

prc5 commented Sep 14, 2019

I've added onZoomChange function to the new version 👍

@mpyrc mpyrc closed this as completed in 341afab Sep 15, 2019
@ghost
Copy link

ghost commented Nov 26, 2019

It seems that this is not called when you call zoomIn, zoomOut or double click still. Only when you scroll to zoom this is being called back.

@ghost
Copy link

ghost commented Nov 26, 2019

@naveenprakash74
Copy link

I've added onZoomChange function to the new version

onZoomChange called many times. I want to get the last values {scale, positionX, positionY, previousScale}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants