Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvo committed Dec 4, 2024
1 parent 1331805 commit 38dfb93
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 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: 3 additions & 3 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: 2 additions & 2 deletions lib/typescript/ReactNativeZoomableView.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ declare class ReactNativeZoomableView extends Component<ReactNativeZoomableViewP
zoomTo(newZoomLevel: number, zoomCenter?: {
x: number;
y: number;
}): true | undefined;
}): boolean;
/**
* Zooms in or out by a specified change level
* Use a positive number for `zoomLevelChange` to zoom in
Expand All @@ -220,7 +220,7 @@ declare class ReactNativeZoomableView extends Component<ReactNativeZoomableViewP
*
* @return {bool}
*/
zoomBy(zoomLevelChange: number): true | undefined;
zoomBy(zoomLevelChange: number): boolean;
/**
* Moves the zoomed view to a specified position
* Returns a promise when finished
Expand Down
6 changes: 3 additions & 3 deletions src/ReactNativeZoomableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,9 @@ class ReactNativeZoomableView extends Component<
* @param zoomCenter relative coords compared to the zoom subject. Default to the center.
*/
zoomTo(newZoomLevel: number, zoomCenter = { x: 0, y: 0 }) {
if (!this.props.zoomEnabled) return;
if (this.props.maxZoom && newZoomLevel > this.props.maxZoom) return;
if (this.props.minZoom && newZoomLevel < this.props.minZoom) return;
if (!this.props.zoomEnabled) return false;
if (this.props.maxZoom && newZoomLevel > this.props.maxZoom) return false;
if (this.props.minZoom && newZoomLevel < this.props.minZoom) return false;

this.props.onZoomBefore?.(null, null, this._getZoomableViewEventObject());

Expand Down

0 comments on commit 38dfb93

Please sign in to comment.