From 51095160f1cb17b1d8226dc4de04fdbc64aaffa8 Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Thu, 12 Jan 2023 23:41:01 -0300 Subject: [PATCH] fix scaled rotate handle Signed-off-by: Victor Seiji Hariki --- index.html | 4 ++-- js/ui/tool/generic.js | 6 ++++-- js/ui/tool/stamp.js | 2 +- pages/embed.test.html | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 9cc895f..e4fc4b4 100644 --- a/index.html +++ b/index.html @@ -370,7 +370,7 @@ @@ -383,7 +383,7 @@ - + diff --git a/js/ui/tool/generic.js b/js/ui/tool/generic.js index 62d19f1..04073b8 100644 --- a/js/ui/tool/generic.js +++ b/js/ui/tool/generic.js @@ -399,10 +399,12 @@ const _tool = { } hoveringRotateHandle(x, y, scale = 1) { - const localc = this.matrix.inverse().transformPoint({x, y}); + const localc = this.rtmatrix.inverse().transformPoint({x, y}); const localrh = { x: 0, - y: -this.canvas.height / 2 - config.rotateHandleDistance * scale, + y: + (-this.scale.y * this.canvas.height) / 2 - + config.rotateHandleDistance * scale, }; const dx = Math.abs(localc.x - localrh.x); diff --git a/js/ui/tool/stamp.js b/js/ui/tool/stamp.js index 31cd054..2ac60bd 100644 --- a/js/ui/tool/stamp.js +++ b/js/ui/tool/stamp.js @@ -472,7 +472,7 @@ const stampTool = () => min: 0.01, max: 10, step: 0.1, - textStep: 0.01, + textStep: 0.001, }); state.ctxmenu.scaleSlider = scaleSlider.slider; state.setScale = scaleSlider.setValue; diff --git a/pages/embed.test.html b/pages/embed.test.html index 729eacd..b4ac0ab 100644 --- a/pages/embed.test.html +++ b/pages/embed.test.html @@ -8,8 +8,8 @@