Fix viewport context menu not working on touch

This commit is contained in:
JannisX11 2023-04-17 22:45:39 +02:00
parent 20315bf016
commit 723bb4b061

View File

@ -713,11 +713,11 @@ class Preview {
unselectInterface(event);
convertTouchEvent(event);
Preview.selected = this;
this.static_rclick = event.which === 3 || event.type == 'touchstart';
this.static_rclick = event.which === 3 || event.pointerType == 'touch';
if (this.static_rclick) {
this.event_start = [event.clientX, event.clientY];
}
if (event.type == 'touchstart') {
if (event.pointerType == 'touch') {
this.rclick_cooldown = setTimeout(() => {
this.rclick_cooldown = true;
}, 420)
@ -1092,7 +1092,7 @@ class Preview {
this.selection.client_x = event.clientX+0
this.selection.client_y = event.clientY+0
if (Modes.edit && event.type !== 'touchstart') {
if (Modes.edit && event.pointerType != 'touch') {
$(this.node).append(this.selection.box)
this.selection.activated = false;
this.selection.old_selected = Outliner.selected.slice();