Skip to content

Commit

Permalink
Fix: inconsistent zooms in different screen-sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Blindman139 committed Sep 30, 2023
1 parent 72664c9 commit c7435fe
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 c7435fe

Please sign in to comment.