diff --git a/_server/editor.js b/_server/editor.js index 1a1b100b..bc5a6f08 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -481,7 +481,8 @@ editor.prototype.updateLastUsedMap = function () { ctx.lineWidth = 4; for (var i = 0; i < lastUsed.length; ++i) { try { - var x = i % core.__SIZE__, y = parseInt(i / core.__SIZE__); + var per_row = core.__SIZE__ - 1; + var x = i % per_row, y = parseInt(i / per_row); var info = lastUsed[i]; if (!info || !info.images) continue; if (info.isTile && core.material.images.tilesets[info.images]) { diff --git a/_server/editor_mappanel.js b/_server/editor_mappanel.js index ae10844e..e7e5a30f 100644 --- a/_server/editor_mappanel.js +++ b/_server/editor_mappanel.js @@ -852,7 +852,8 @@ editor_mappanel_wrapper = function (editor) { var px = scrollLeft + e.clientX - editor.dom.mid2.offsetLeft - editor.dom.lastUsedDiv.offsetLeft + editor.dom.lastUsedDiv.scrollLeft, py = scrollTop + e.clientY - editor.dom.mid2.offsetTop - editor.dom.lastUsedDiv.offsetTop + editor.dom.lastUsedDiv.scrollTop; var x = parseInt(px / 32), y = parseInt(py / 32); - var index = x + core.__SIZE__ * y; + if (x == core.__SIZE__ - 1) return false; + var index = x + (core.__SIZE__ - 1) * y; if (index >= editor.uivalues.lastUsed.length) return; var lastUsed = editor.uivalues.lastUsed.sort(function (a, b) { if ((a.istop || 0) != (b.istop || 0)) return (b.istop || 0) - (a.istop || 0);