From 6e614ff061f623a22fced8820089f1279a28aec2 Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Sat, 25 Oct 2025 19:32:00 +0900
Subject: Revert "Fix touch position offset in image masking on iOS devices
 (#16702)"

This reverts commit 456504cf8281c972fded04e1496498d494891707.
---
 .../frontend/src/components/MkImageEffectorDialog.vue    | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

(limited to 'packages/frontend/src/components/MkImageEffectorDialog.vue')

diff --git a/packages/frontend/src/components/MkImageEffectorDialog.vue b/packages/frontend/src/components/MkImageEffectorDialog.vue
index 0fc8fa9dcc..19ddb81919 100644
--- a/packages/frontend/src/components/MkImageEffectorDialog.vue
+++ b/packages/frontend/src/components/MkImageEffectorDialog.vue
@@ -257,12 +257,8 @@ function onImagePointerdown(ev: PointerEvent) {
 	xOffset /= 2;
 	yOffset /= 2;
 
-	const rect = canvasEl.value.getBoundingClientRect();
-	const pointerOffsetX = ev.clientX - rect.left;
-	const pointerOffsetY = ev.clientY - rect.top;
-
-	let startX = pointerOffsetX - xOffset;
-	let startY = pointerOffsetY - yOffset;
+	let startX = ev.offsetX - xOffset;
+	let startY = ev.offsetY - yOffset;
 
 	if (AW / AH < BW / BH) { // 横長
 		startX = startX / (Math.max(AW, AH) / Math.max(BH / BW, 1));
@@ -315,11 +311,9 @@ function onImagePointerdown(ev: PointerEvent) {
 		});
 	}
 
-	_move(ev.clientX, ev.clientY);
+	_move(ev.offsetX, ev.offsetY);
 
-	function _move(pointerClientX: number, pointerClientY: number) {
-		const pointerX = pointerClientX - rect.left;
-		const pointerY = pointerClientY - rect.top;
+	function _move(pointerX: number, pointerY: number) {
 		let x = pointerX - xOffset;
 		let y = pointerY - yOffset;
 
@@ -346,7 +340,7 @@ function onImagePointerdown(ev: PointerEvent) {
 	}
 
 	function move(ev: PointerEvent) {
-		_move(ev.clientX, ev.clientY);
+		_move(ev.offsetX, ev.offsetY);
 	}
 
 	function up() {
-- 
cgit v1.2.3-freya

