Merge pull request #400 from zhaouv/v2.x

fix editor.viewportLoc
This commit is contained in:
Zhang Chen 2019-10-19 09:09:24 +08:00 committed by GitHub
commit 7d61b4f73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -344,6 +344,7 @@ editor.prototype.updateMap = function () {
editor.prototype.setViewport=function (x, y) {
core.bigmap.offsetX = core.clamp(x, 0, 32*core.bigmap.width-core.__PIXELS__);
core.bigmap.offsetY = core.clamp(y, 0, 32*core.bigmap.height-core.__PIXELS__);
editor.viewportLoc = editor.viewportLoc || {};
editor.viewportLoc[editor.currentFloorId] = [core.bigmap.offsetX, core.bigmap.offsetY];
core.control.updateViewport();
editor.buildMark();