Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Slow zoom out with fingers gets stuck on scale less than 1 fix(It wasn't recovering back to scale 1) #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/image-zoom/image-zoom.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default class ImageViewer extends React.Component<ImageZoomProps, ImageZo
const moveDistance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
const { locationX, locationY, pageX, pageY } = evt.nativeEvent;

if (evt.nativeEvent.changedTouches.length === 1 && moveDistance < (this.props.clickDistance || 0)) {
if (this.scale >= 1 && evt.nativeEvent.changedTouches.length === 1 && moveDistance < (this.props.clickDistance || 0)) {
this.singleClickTimeout = setTimeout(() => {
if (this.props.onClick) {
this.props.onClick({ locationX, locationY, pageX, pageY });
Expand Down