Skip to content

Commit 31795fb

Browse files
committed
[mv3] Remove obsolete code paths in picker tool
1 parent 2d2de3a commit 31795fb

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

platform/mv3/extension/js/tool-overlay-ui.js

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,8 @@ export const toolOverlay = {
166166
if ( target.matches('#move') === false ) { return; }
167167
if ( dom.cl.has(this.moveable, 'moving') ) { return; }
168168
target.setPointerCapture(ev.pointerId);
169-
this.moverIsTouch = ev.type.startsWith('touch');
170-
if ( this.moverIsTouch ) {
171-
const touch = ev.touches[0];
172-
this.moverX0 = touch.pageX;
173-
this.moverY0 = touch.pageY;
174-
} else {
175-
this.moverX0 = ev.pageX;
176-
this.moverY0 = ev.pageY;
177-
}
169+
this.moverX0 = ev.pageX;
170+
this.moverY0 = ev.pageY;
178171
const rect = this.moveable.getBoundingClientRect();
179172
this.moverCX0 = rect.x + rect.width / 2;
180173
this.moverCY0 = rect.y + rect.height / 2;
@@ -211,14 +204,8 @@ export const toolOverlay = {
211204
}
212205
},
213206
moverMoveAsync(ev) {
214-
if ( toolOverlay.moverIsTouch ) {
215-
const touch = ev.touches[0];
216-
toolOverlay.moverX1 = touch.pageX;
217-
toolOverlay.moverY1 = touch.pageY;
218-
} else {
219-
toolOverlay.moverX1 = ev.pageX;
220-
toolOverlay.moverY1 = ev.pageY;
221-
}
207+
toolOverlay.moverX1 = ev.pageX;
208+
toolOverlay.moverY1 = ev.pageY;
222209
if ( toolOverlay.moverTimer !== undefined ) { return; }
223210
toolOverlay.moverTimer = self.requestAnimationFrame(( ) => {
224211
toolOverlay.moverMove();
@@ -241,7 +228,6 @@ export const toolOverlay = {
241228
ev.preventDefault();
242229
},
243230
moveable: null,
244-
moverIsTouch: false,
245231
moverX0: 0, moverY0: 0,
246232
moverX1: 0, moverY1: 0,
247233
moverCX0: 0, moverCY0: 0,

0 commit comments

Comments
 (0)