From 650157bc7a1c328c5dd51c694295e51d2226c3bd Mon Sep 17 00:00:00 2001 From: Yueyu Date: Mon, 23 Aug 2021 19:02:12 +0800 Subject: [PATCH] Set screen matrix scale to Paint.currentZoom --- src/painteditor/PaintAction.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/painteditor/PaintAction.js b/src/painteditor/PaintAction.js index 9736a3b..6efd9ff 100644 --- a/src/painteditor/PaintAction.js +++ b/src/painteditor/PaintAction.js @@ -1139,12 +1139,10 @@ export default class PaintAction { pt2.x = pt.x; pt2.y = pt.y; var screenMatrix = Paint.root.getScreenCTM(); + // screenMatrix should include the currentScale, apply scaling + screenMatrix.a = Paint.currentZoom; + screenMatrix.d = Paint.currentZoom; var globalPoint = pt2.matrixTransform(screenMatrix.inverse()); - // screenMatrix should include the currentScale, if it doesn't match, apply scaling - if (screenMatrix.a != Paint.currentZoom) { - globalPoint.x = globalPoint.x / Paint.currentZoom; - globalPoint.y = globalPoint.y / Paint.currentZoom; - } return globalPoint; } }