Skip to content
Merged
Show file tree
Hide file tree
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
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
Loading