Skip to content

Commit

Permalink
Merge pull request #82 from Blindman139/master
Browse files Browse the repository at this point in the history
Fix: inconsistent zooms in different screen-sizes
  • Loading branch information
retyui authored Oct 2, 2023
2 parents 72664c9 + c7435fe commit 4b13484
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/PinchZoom/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,15 @@ class PinchZoom extends React.Component<Props> {
}

alignCenter(options: ScaleToOptions) {
const { x, y, scale, animated, duration } = {
const { x: __x, y: __y, scale, animated, duration } = {
duration: 250,
animated: true,
...options,
};

// Bug-Fix: https://github.com/retyui/react-quick-pinch-zoom/issues/58
const x = __x * this._initialZoomFactor;
const y = __y * this._initialZoomFactor;

const startZoomFactor = this._zoomFactor;
const startOffset = { ...this._offset };
Expand Down

0 comments on commit 4b13484

Please sign in to comment.