@@ -2,7 +2,7 @@ import { THREE } from '../lib/libs';
22import OrbitControls from './OrbitControls' ;
33import StateMemory from "../util/state_memory" ;
44import { ConfigDialog } from '../interface/dialog' ;
5- import { getFaceKeyFromIndex , toSnakeCase } from '../util/util' ;
5+ import { getFaceKeyFromIndex , isTouchEvent , toSnakeCase } from '../util/util' ;
66import { electron , ipcRenderer } from '../native_apis' ;
77import { Pressing } from '../misc' ;
88import { CSS3DRenderer } from '../lib/CSS3DRenderer' ;
@@ -1612,7 +1612,7 @@ export class Preview {
16121612 mouseup ( event : MouseEvent ) {
16131613 this . showContextMenu ( event ) ;
16141614 if ( settings . canvas_unselect . value &&
1615- ( event . which === 1 || event . which === 3 || event instanceof TouchEvent ) &&
1615+ ( event . which === 1 || event . which === 3 || isTouchEvent ( event ) ) &&
16161616 ! this . controls . hasMoved &&
16171617 ! this . selection . activated &&
16181618 ! Transformer . was_clicked &&
@@ -1622,7 +1622,7 @@ export class Preview {
16221622 unselectAllElements ( ) ;
16231623 }
16241624 delete this . selection . click_target ;
1625- if ( event instanceof TouchEvent ) {
1625+ if ( isTouchEvent ( event ) ) {
16261626 Canvas . scene . remove ( Canvas . brush_outline ) ;
16271627 }
16281628 return this ;
@@ -1685,7 +1685,7 @@ export class Preview {
16851685 Transformer . setCanvas ( this . canvas ) ;
16861686 Preview . selected . controls . update ( ) ;
16871687 }
1688- if ( event instanceof TouchEvent ) {
1688+ if ( isTouchEvent ( event ) ) {
16891689 Transformer . simulateMouseDown ( event ) ;
16901690 }
16911691 return this ;
0 commit comments