Fix scale

This commit is contained in:
oc 2018-08-24 23:19:03 +08:00
parent 7551dd3c72
commit 656cd92c20
3 changed files with 13 additions and 4 deletions

View File

@ -476,7 +476,7 @@ actions.prototype.onup = function () {
for(var ii=1;ii<core.status.stepPostfix.length;ii++){
var pos0 = core.status.stepPostfix[ii-1];
var pos = core.status.stepPostfix[ii];
stepPostfix.push({'direction': direction[pos.x-pos0.x][pos.y-pos0.y], 'x': pos.x, 'y': pos.y});
stepPostfix.push({'direction': direction[pos.x-pos0.x][pos.y-pos0.y], 'x': pos.x+parseInt(core.bigmap.offsetX/32), 'y': pos.y+parseInt(core.bigmap.offsetY/32)});
}
var posx=core.status.stepPostfix[0].x;
var posy=core.status.stepPostfix[0].y;

View File

@ -632,7 +632,7 @@ control.prototype.automaticRoute = function (destX, destY) {
////// 显示离散的寻路点 //////
control.prototype.fillPosWithPoint = function (pos) {
core.fillRect('route', pos.x*32+12,pos.y*32+12,8,8, '#bfbfbf');
core.fillRect('route', pos.x*32+12+core.bigmap.offsetX,pos.y*32+12+core.bigmap.offsetY,8,8, '#bfbfbf');
}
////// 设置勇士的自动行走路线 //////
@ -985,6 +985,8 @@ control.prototype.stopHero = function () {
////// 设置画布偏移
control.prototype.setGameCanvasTranslate = function(canvas,x,y){
var c=core.dom.gameCanvas[canvas];
x=x*core.domStyle.scale;
y=y*core.domStyle.scale;
c.style.transform='translate('+x+'px,'+y+'px)';
c.style.webkitTransform='translate('+x+'px,'+y+'px)';
c.style.OTransform='translate('+x+'px,'+y+'px)';
@ -2817,6 +2819,13 @@ control.prototype.resize = function(clientWidth, clientHeight) {
left: (clientWidth-gameGroupWidth)/2 + unit,
}
},
{
className: 'gameCanvas',
rules:{
width: (canvasWidth - SPACE*2) + unit,
height: (canvasWidth - SPACE*2) + unit,
}
},
{
id: 'gif',
rules: {

View File

@ -190,8 +190,8 @@ maps.prototype.resizeMap = function(floorId) {
core.bigmap.canvas.forEach(function(cn){
core.canvas[cn].canvas.setAttribute("width",cwidth);
core.canvas[cn].canvas.setAttribute("height",cheight);
core.canvas[cn].canvas.style.width = cwidth;
core.canvas[cn].canvas.style.height = cheight;
core.canvas[cn].canvas.style.width = cwidth*core.domStyle.scale + "px";
core.canvas[cn].canvas.style.height = cheight*core.domStyle.scale + "px";
});
}