From b7bd06bd849feab239900d2fd7622787ac48c112 Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 27 Aug 2018 14:35:47 +0800 Subject: [PATCH 1/3] fix gameCanvas.style in editor-mobile --- libs/maps.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/maps.js b/libs/maps.js index d496a9c7..2e3a9c4f 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -192,6 +192,10 @@ maps.prototype.resizeMap = function(floorId) { core.canvas[cn].canvas.setAttribute("height",cheight); core.canvas[cn].canvas.style.width = cwidth*core.domStyle.scale + "px"; core.canvas[cn].canvas.style.height = cheight*core.domStyle.scale + "px"; + if(main.mode==='editor' && editor.isMobile){ + core.canvas[cn].canvas.style.width = core.bigmap.width*32/416*96 + "vw"; + core.canvas[cn].canvas.style.height = core.bigmap.height*32/416*96 + "vw"; + } }); } From 6f912dfcb2b9b1269354d5ca923fc4a69cd178ee Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 27 Aug 2018 14:46:08 +0800 Subject: [PATCH 2/3] fix gameCanvas.style in editor-mobile --- libs/control.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/control.js b/libs/control.js index 4a3f2468..b98fd7a1 100644 --- a/libs/control.js +++ b/libs/control.js @@ -986,6 +986,12 @@ control.prototype.setGameCanvasTranslate = function(canvas,x,y){ c.style.webkitTransform='translate('+x+'px,'+y+'px)'; c.style.OTransform='translate('+x+'px,'+y+'px)'; c.style.MozTransform='translate('+x+'px,'+y+'px)'; + if(main.mode==='editor' && editor.isMobile){ + c.style.transform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + c.style.webkitTransform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + c.style.OTransform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + c.style.MozTransform='translate('+(x/416*96)+'vw,'+(y/416*96)+'vw)'; + } }; ////// 更新视野范围 ////// From 5e99393cab4d1b25bb710516419f7ea6d56559ce Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 27 Aug 2018 14:54:48 +0800 Subject: [PATCH 3/3] drawEventBlock : mutli --- _server/editor.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/_server/editor.js b/_server/editor.js index 4e5c516d..cbb4f6d1 100644 --- a/_server/editor.js +++ b/_server/editor.js @@ -202,23 +202,23 @@ editor.prototype.drawEventBlock = function () { fg.clearRect(0, 0, 416, 416); for (var i=0;i<13;i++) { for (var j=0;j<13;j++) { - var color=null; + var color=[]; var loc=(i+core.bigmap.offsetX/32)+","+(j+core.bigmap.offsetY/32); if (core.isset(editor.currentFloorData.events[loc])) - color = '#FF0000'; - else if (core.isset(editor.currentFloorData.changeFloor[loc])) - color = '#00FF00'; - else if (core.isset(editor.currentFloorData.afterBattle[loc])) - color = '#FFFF00'; - else if (core.isset(editor.currentFloorData.afterGetItem[loc])) - color = '#00FFFF'; - else if (core.isset(editor.currentFloorData.afterOpenDoor[loc])) - color = '#FF00FF'; - else if (core.isset(editor.currentFloorData.cannotMove[loc])) - color = '#0000FF'; - if (color!=null) { - fg.fillStyle = color; - fg.fillRect(32*i, 32*j+32-8, 8, 8); + color.push('#FF0000'); + if (core.isset(editor.currentFloorData.changeFloor[loc])) + color.push('#00FF00'); + if (core.isset(editor.currentFloorData.afterBattle[loc])) + color.push('#FFFF00'); + if (core.isset(editor.currentFloorData.afterGetItem[loc])) + color.push('#00FFFF'); + if (core.isset(editor.currentFloorData.afterOpenDoor[loc])) + color.push('#FF00FF'); + if (core.isset(editor.currentFloorData.cannotMove[loc])) + color.push('#0000FF'); + for(var kk=0,cc;cc=color[kk];kk++){ + fg.fillStyle = cc; + fg.fillRect(32*i+8*kk, 32*j+32-8, 8, 8); } } }