Skip to content

Commit

Permalink
🐛 Fix rooms' tile editor not accepting 0 as tile layer depth
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Sep 27, 2024
1 parent 6075757 commit 2b2bd09
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/riotTags/editors/room-editor/room-tile-editor.tag
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ room-tile-editor.room-editor-Tiles.flexfix(class="{opts.class}")
.cancelBtn(this.vocGlob.cancel)
.prompt(this.vocFull.roomView.newDepth)
.then(e => {
if (e.inputValue && Number(e.inputValue)) {
const n = Number(e.inputValue);
if (isFinite(n)) {
const before = layer.zIndex;
layer.zIndex = Number(e.inputValue);
layer.zIndex = n;
this.opts.layers.sort((a, b) => b.zIndex - a.zIndex);
this.opts.pixieditor.history.pushChange({
type: 'propChange',
Expand All @@ -133,9 +134,10 @@ room-tile-editor.room-editor-Tiles.flexfix(class="{opts.class}")
.defaultValue(-10)
.prompt(this.vocFull.roomView.newDepth)
.then(e => {
if (e.inputValue && Number(e.inputValue)) {
const n = Number(e.inputValue);
if (isFinite(n)) {
const layer = {
depth: Number(e.inputValue),
depth: n,
tiles: [],
extends: {},
cache: true
Expand Down

0 comments on commit 2b2bd09

Please sign in to comment.