mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
replace MouseEvent.which with MouseEvent.button
This commit is contained in:
parent
88a1c733bd
commit
da94d5264a
@ -311,7 +311,7 @@ export class ClickDetector {
|
|||||||
const position = /** @type {typeof ClickDetector} */ (this.constructor).extractPointerPosition(event);
|
const position = /** @type {typeof ClickDetector} */ (this.constructor).extractPointerPosition(event);
|
||||||
|
|
||||||
if (event instanceof MouseEvent) {
|
if (event instanceof MouseEvent) {
|
||||||
const isRightClick = event.which == 3;
|
const isRightClick = event.button === 2;
|
||||||
if (isRightClick) {
|
if (isRightClick) {
|
||||||
// Ignore right clicks
|
// Ignore right clicks
|
||||||
this.rightClick.dispatch(position, event);
|
this.rightClick.dispatch(position, event);
|
||||||
@ -384,7 +384,7 @@ export class ClickDetector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event instanceof MouseEvent) {
|
if (event instanceof MouseEvent) {
|
||||||
const isRightClick = event.which == 3;
|
const isRightClick = event.button === 2;
|
||||||
if (isRightClick) {
|
if (isRightClick) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -436,11 +436,11 @@ export class Camera extends BasicSerializableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.touchPostMoveVelocity = new Vector(0, 0);
|
this.touchPostMoveVelocity = new Vector(0, 0);
|
||||||
if (event.which === 1) {
|
if (event.button === 0) {
|
||||||
this.combinedSingleTouchStartHandler(event.clientX, event.clientY);
|
this.combinedSingleTouchStartHandler(event.clientX, event.clientY);
|
||||||
} else if (event.which === 2) {
|
} else if (event.button === 1) {
|
||||||
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.middle);
|
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.middle);
|
||||||
} else if (event.which === 3) {
|
} else if (event.button === 2) {
|
||||||
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.right);
|
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.right);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -460,7 +460,7 @@ export class Camera extends BasicSerializableObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.which === 1) {
|
if (event.button === 0) {
|
||||||
this.combinedSingleTouchMoveHandler(event.clientX, event.clientY);
|
this.combinedSingleTouchMoveHandler(event.clientX, event.clientY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user