From 864cbc1f16fcd4b63440d333b1d562a967e75115 Mon Sep 17 00:00:00 2001 From: Konrad Mayer <64093101+konipro@users.noreply.github.com> Date: Wed, 23 Feb 2022 04:02:57 +0100 Subject: [PATCH] Fix zoomTo greater than or equal to max/min-size The zoomTo event now also supports the minZoom value and the maxZoom value. Before you could not zoom to 1 with zoomTo if the minZoom was 1. --- src/ReactNativeZoomableView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ReactNativeZoomableView.tsx b/src/ReactNativeZoomableView.tsx index 989d909..cbc5295 100644 --- a/src/ReactNativeZoomableView.tsx +++ b/src/ReactNativeZoomableView.tsx @@ -730,7 +730,7 @@ class ReactNativeZoomableView extends Component { return new Promise((resolve) => { // if we would go out of our min/max limits -> abort - if (newZoomLevel >= this.props.maxZoom || newZoomLevel <= this.props.minZoom) { + if (newZoomLevel > this.props.maxZoom || newZoomLevel < this.props.minZoom) { resolve(false); return; }