Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvo committed Oct 29, 2024
1 parent 9c5ccd8 commit 23ded10
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions lib/commonjs/ReactNativeZoomableView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/commonjs/ReactNativeZoomableView.js.map

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions lib/module/ReactNativeZoomableView.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/module/ReactNativeZoomableView.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/ReactNativeZoomableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class ReactNativeZoomableView extends Component<
private set gestureStarted(v: boolean) {
this._gestureStarted = v;
}

public get gestureStarted() {
return this._gestureStarted;
}
Expand Down Expand Up @@ -690,7 +691,8 @@ class ReactNativeZoomableView extends Component<
const gestureCenterPoint = calcGestureCenterPoint(e, gestureState);

if (!gestureCenterPoint) return;
if (!this.state.originalPageX || !this.state.originalPageY) return;
if (this.state.originalPageX == null) return;
if (this.state.originalPageY == null) return;

let zoomCenter = {
x: gestureCenterPoint.x - this.state.originalPageX,
Expand Down Expand Up @@ -767,7 +769,9 @@ class ReactNativeZoomableView extends Component<
) {
const { touches } = gestureResponderEvent.nativeEvent;
const { originalPageY, originalPageX } = this.state;
if (!originalPageX || !originalPageY) return;
if (originalPageX == null) return;
if (originalPageY == null) return;

this.setState({
debugPoints: [
{
Expand Down

0 comments on commit 23ded10

Please sign in to comment.