diff --git a/_server/editor.js b/_server/editor.js index f5c7d0e1..d515dec6 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -308,7 +308,7 @@ editor.prototype.listen = function () { function fillPos(pos) { uc.fillStyle = '#' + ~~(Math.random() * 8) + ~~(Math.random() * 8) + ~~(Math.random() * 8); - uc.fillRect(pos.x * 32 + 12, pos.y * 32 + 12, 8, 8); + uc.fillRect(pos.x * 32 + 12 - core.bigmap.offsetX, pos.y * 32 + 12 - core.bigmap.offsetY, 8, 8); }//在格子内画一个随机色块 function eToLoc(e) { @@ -325,7 +325,7 @@ editor.prototype.listen = function () { }//返回可用的组件内坐标 function locToPos(loc) { - editor.pos = {'x': ~~(loc.x / loc.size), 'y': ~~(loc.y / loc.size)} + editor.pos = {'x': ~~(loc.x / loc.size)+core.bigmap.offsetX/32, 'y': ~~(loc.y / loc.size)+core.bigmap.offsetY/32} return editor.pos; } diff --git a/_server/vm.js b/_server/vm.js index 312507fa..a95e1cfa 100644 --- a/_server/vm.js +++ b/_server/vm.js @@ -24,7 +24,14 @@ document.body.onmousedown = function (e) { } }); - if (clickpath.indexOf('edit') === -1 && clickpath.indexOf('tip') === -1 && clickpath.indexOf('brushMod') === -1 && clickpath.indexOf('brushMod2') === -1) { + var unselect=true; + for(var ii=0,thisId;thisId=['edit','tip','brushMod','brushMod2','viewportButtons'][ii];ii++){ + if (clickpath.indexOf(thisId) !== -1){ + unselect=false; + break; + } + } + if (unselect) { if (clickpath.indexOf('eui') === -1) { if (selectBox.isSelected) { editor_mode.onmode(''); diff --git a/editor.html b/editor.html index 22b17d73..86a9a5f5 100644 --- a/editor.html +++ b/editor.html @@ -5,6 +5,11 @@ +
--> @@ -433,6 +448,24 @@ if (location.protocol.indexOf("http")!=0) {