Skip to content

Commit

Permalink
Merge pull request #147 from sasza2/feat/zoom-position
Browse files Browse the repository at this point in the history
feat: zoom position
  • Loading branch information
sasza2 authored Mar 21, 2024
2 parents bc9a0a1 + b647212 commit 785011f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-worms-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sasza/react-panzoom": minor
---

zoom position feature
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@
"react": ">=16.14.0"
},
"dependencies": {
"panzoom-core": "1.5.0"
"panzoom-core": "1.6.0"
}
}
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

6 changes: 6 additions & 0 deletions types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ type OnContextMenu = (

export type Zoom = Ref<number>;

export type ZoomPosition = {
x?: number | 'center',
y?: number | 'center',
}

export type PanZoomOptions = {
boundary?: BoundaryProp;
className?: string;
Expand All @@ -81,6 +86,7 @@ export type PanZoomOptions = {
zoomInitial?: number;
zoomMax?: number;
zoomMin?: number;
zoomPosition?: ZoomPosition;
zoomSpeed?: number;
} & Size

Expand Down

0 comments on commit 785011f

Please sign in to comment.