Fix Zoom Centre (#135)

This commit is contained in:
filtered
2024-11-29 03:54:09 +11:00
committed by GitHub
parent eb54546ac9
commit 2a39b21578

View File

@@ -222,6 +222,8 @@ export class DragAndScale {
if (!rect) return
zooming_center = zooming_center || [rect.width * 0.5, rect.height * 0.5]
zooming_center[0] -= rect.x
zooming_center[1] -= rect.y
const center = this.convertCanvasToOffset(zooming_center)
this.scale = value
if (Math.abs(this.scale - 1) < 0.01) this.scale = 1