drozhzhin-n-e / ngx-pinch-zoom

Module provides for image zooming and positioning with use of gestures on a touch screen.
http://ivylab.space/pinch-zoom
MIT License
113 stars 95 forks source link

get zoom state? #52

Closed Simbaclaws closed 4 years ago

Simbaclaws commented 4 years ago

Hey there,

Apparently it's possible to toggle the zoom programmatically depending on the current state. What If I only want to zoom out whenever it's zoomed in on a specific action?

Can I somehow get the current zoom state (zoomed in, or zoomed out)?

I find it quite strange that there is only a toggle and not for example a zoomOut and zoomIn. Or at least a state to determine when to toggle.

Can I just check for the class pz-dragging?

Simbaclaws commented 4 years ago

Apparently checking for pz-dragging on the pinch-zoom div child works.

drozhzhin-n-e commented 4 years ago

@Simbaclaws What you are talking about is in the Pro version. You can make a subscription to the state change. More details here: http://ivylab.space/pinch-zoom