DuDigital / react-native-zoomable-view

A view component for react-native with pinch to zoom, tap to move and double tap to zoom capability.
MIT License
241 stars 112 forks source link

Initial zoom value and pinch to zoom bug #54

Open HarryCamigla opened 3 years ago

HarryCamigla commented 3 years ago

Found this bug when your initialZoom value is less than 1

The bug causes the zoom value to 1 during the first pinch gesture. In ReactNativeZoomableView.js fie in Line 32 you need to update as below

this.state = { zoomLevel: props.initialZoom, ...initialState, lastZoomLevel:props.initialZoom ? props.initialZoom : 1, offsetX: props.initialOffsetX, offsetY: props.initialOffsetY, };

SimonErich commented 3 years ago

@HarryCamigla sorry for taking so long to respond to this. I could not reproduce this with the latest version. Could you maybe check if the problem still persists? If yes: please provide a small example of the way you implement the component. Do you have minZoom set to a number smaller than your intiialZoom ?