From 6f912dfcb2b9b1269354d5ca923fc4a69cd178ee Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Mon, 27 Aug 2018 14:46:08 +0800 Subject: [PATCH] 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)'; + } }; ////// 更新视野范围 //////