Skip to content

Commit

Permalink
更新移动端缩放
Browse files Browse the repository at this point in the history
  • Loading branch information
more-strive committed Aug 18, 2024
1 parent ad7be9f commit 41fae3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/hooks/useCanvasScale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default () => {
if (command === '-' && percentage >= min) percentage -= step
const { centerPoint } = useCenter()
canvas.zoomToPoint(centerPoint, percentage / 100)
canvas.absolutePan(new Point(centerPoint.x, centerPoint.y).scalarMultiply(canvas.getZoom()).subtract(canvas.getCenterPoint()))
zoom.value = canvas.getZoom()
}

Expand Down

0 comments on commit 41fae3e

Please sign in to comment.