openspacelabs/react-native-zoomable-view

zoomTo should allow to reach exactly the minZoom or maxZoom

Closed this issue · 2 comments

Hey team, right now, if we do the following:

In zoomTo(https://github.com/openspacelabs/react-native-zoomable-view/blob/master/src/ReactNativeZoomableView.tsx#L930),

The check to see if it's a valid zoom is

        newZoomLevel >= this.props.maxZoom ||
        newZoomLevel <= this.props.minZoom

But this would mean that it's not possible to "reset" to the minZoom:

<ReactNativeZoomableView minZoom={1} ref={zoomableRef}>...</ReactNativeZoomableView>
...
zoomableRef.current!.zoomTo(1) // fail

Should this check of < and >, instead of <= and >= ?

@stopachka Seems like it would work! Would you mind creating a pull request with this change?

Should be fixed in #34