Skip to content

Commit

Permalink
Change y-axis to match ingame editor
Browse files Browse the repository at this point in the history
fixes #37
  • Loading branch information
ufdada committed May 6, 2016
1 parent ab03343 commit d2ca2ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,14 @@ function Map(sizex, sizey) {

this.displayRoom = function(evt) {
map.insertTile(this, true, false);
var row = this.parentNode;
var table = row.parentNode;

// Info box
map.setHtml("posx", this.cellIndex + 1 - map.borderSize);
var posy = this.parentNode.rowIndex != -1 ? this.parentNode.rowIndex : this.parentNode.sectionRowIndex;
map.setHtml("posy", posy + 1 - map.borderSize);
var posy = row.rowIndex != -1 ? row.rowIndex : row.sectionRowIndex;
posy = table.rows.length - posy;
map.setHtml("posy", posy - map.borderSize);

// Drag and Drop
var roomTile = tiles[map.currentTile];
Expand Down

0 comments on commit d2ca2ea

Please sign in to comment.