Skip to content

Commit

Permalink
Fix the static pin being moved to incorrect position (#120)
Browse files Browse the repository at this point in the history
Co-authored-by: thomasvo <[email protected]>
  • Loading branch information
thomasttvo and thomasvo authored Oct 30, 2024
1 parent 9c5ccd8 commit 115c884
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 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.

4 changes: 4 additions & 0 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.

4 changes: 4 additions & 0 deletions src/ReactNativeZoomableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ class ReactNativeZoomableView extends Component<
// we don't wanna measure when zoomSubjectWrapperRef is not yet available or has been unmounted
zoomSubjectWrapperRef.current?.measureInWindow(
(x, y, width, height) => {
// When the component is off-screen, these become all 0s, so we don't set them
// to avoid messing up calculations, especially ones that are done right after
// the component transitions from hidden to visible.
if (!x && !y && !width && !height) return;
this.setState({
originalWidth: width,
originalHeight: height,
Expand Down

0 comments on commit 115c884

Please sign in to comment.