File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,15 @@ export class CameraPanBehavior extends Behavior {
6868 } ) ;
6969 }
7070
71+ #ignoreTilemap( ) : boolean {
72+ const entity = this . ui ?. selectedEntity . entities [ 0 ] ;
73+ if ( ! entity ) return false ;
74+ if ( ! ( entity instanceof EditorFacadeTilemap ) ) return false ;
75+
76+ // TODO: need inspector ui root instead of document (prevent crosstalk between edit and play)
77+ return document . querySelector ( "[data-tab-id=tilemap][data-active]" ) !== null ;
78+ }
79+
7180 #setDrag( value : Vector2 | undefined ) {
7281 this . #drag = value ;
7382
@@ -103,9 +112,7 @@ export class CameraPanBehavior extends Behavior {
103112 this . #wasGizmo = local . length > 0 ;
104113
105114 if ( ! this . #wasGizmo && event . cursor . world ) {
106- if ( this . ui ?. selectedEntity . entities [ 0 ] instanceof EditorFacadeTilemap ) {
107- return ;
108- }
115+ if ( this . #ignoreTilemap( ) ) return ;
109116
110117 const entities = this . game . entities
111118 . lookupByPosition ( event . cursor . world )
@@ -572,9 +579,7 @@ export class CameraPanBehavior extends Behavior {
572579 return ;
573580 }
574581
575- if ( this . ui ?. selectedEntity . entities [ 0 ] instanceof EditorFacadeTilemap ) {
576- return ;
577- }
582+ if ( this . #ignoreTilemap( ) ) return ;
578583
579584 if ( ! wasMouseDownOverCanvas ) return ;
580585 if ( ! this . #drag && event . button === "left" && event . cursor . world && ! this . #wasGizmo) {
You can’t perform that action at this time.
0 commit comments