Skip to content

Commit 6065840

Browse files
committed
sort tilemaps to bottom
1 parent a3f53b7 commit 6065840

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

editor/client/panning-and-selection.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,6 @@ export class CameraPanBehavior extends Behavior {
603603
.filter(entity => entity.enabled)
604604
.filter(entity => this.ui?.sceneGraph?.entryElementMap?.has(entity.ref) ?? true)
605605
.filter(entity => EditorMetadataEntity.getLockedBy(entity) === undefined)
606-
.filter(entity => !(entity instanceof EditorFacadeTilemap))
607606
.filter(entity => {
608607
// Special case for ComplexCollider
609608
if (entity.constructor.name === "EditorFacadeComplexCollider" && event.cursor.world) {
@@ -626,6 +625,14 @@ export class CameraPanBehavior extends Behavior {
626625
return 1;
627626
}
628627
return 0;
628+
})
629+
.toSorted((a, b) => {
630+
// Move tilemaps to the bottom of the selection list
631+
const aIsTilemap = a instanceof EditorFacadeTilemap;
632+
const bIsTilemap = b instanceof EditorFacadeTilemap;
633+
if (aIsTilemap && !bIsTilemap) return 1;
634+
if (!aIsTilemap && bIsTilemap) return -1;
635+
return 0;
629636
});
630637

631638
if (entities[0] && entities[0].parent instanceof EmptyFacade) {

0 commit comments

Comments
 (0)