fix:(from 2.10.3)修复了缩放过小时会有画面无法清除的bug, 修复了缩放修改时画布大小不正确的bug
This commit is contained in:
parent
ffd8beebf9
commit
7aee907d5d
@ -3511,9 +3511,7 @@ control.prototype._resize_canvas = function (obj) {
|
|||||||
} else {
|
} else {
|
||||||
for (var name in core.dymCanvas) {
|
for (var name in core.dymCanvas) {
|
||||||
var ctx = core.dymCanvas[name], canvas = ctx.canvas;
|
var ctx = core.dymCanvas[name], canvas = ctx.canvas;
|
||||||
var ratio = canvas.hasAttribute('isHD') ? core.domStyle.ratio : 1;
|
core.resizeCanvas(ctx, parseFloat(canvas.getAttribute("_width")), parseFloat(canvas.getAttribute("_height")));
|
||||||
canvas.style.width = canvas.width / ratio * core.domStyle.scale + "px";
|
|
||||||
canvas.style.height = canvas.height / ratio * core.domStyle.scale + "px";
|
|
||||||
canvas.style.left = parseFloat(canvas.getAttribute("_left")) * core.domStyle.scale + "px";
|
canvas.style.left = parseFloat(canvas.getAttribute("_left")) * core.domStyle.scale + "px";
|
||||||
canvas.style.top = parseFloat(canvas.getAttribute("_top")) * core.domStyle.scale + "px";
|
canvas.style.top = parseFloat(canvas.getAttribute("_top")) * core.domStyle.scale + "px";
|
||||||
}
|
}
|
||||||
|
|||||||
10
libs/ui.js
10
libs/ui.js
@ -64,7 +64,13 @@ ui.prototype.clearMap = function (name, x, y, width, height) {
|
|||||||
if (x != null && y != null && width != null && height != null) {
|
if (x != null && y != null && width != null && height != null) {
|
||||||
ctx.clearRect(x, y, width, height);
|
ctx.clearRect(x, y, width, height);
|
||||||
} else {
|
} else {
|
||||||
ctx.clearRect(-32, -32, ctx.canvas.width + 32, ctx.canvas.height + 32);
|
if (ctx.canvas.getAttribute('isHD')) {
|
||||||
|
const width = ctx.canvas.width / core.domStyle.scale / devicePixelRatio;
|
||||||
|
const height = ctx.canvas.height / core.domStyle.scale / devicePixelRatio;
|
||||||
|
ctx.clearRect(0, 0, width, height);
|
||||||
|
} else {
|
||||||
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3446,6 +3452,8 @@ ui.prototype.createCanvas = function (name, x, y, width, height, z) {
|
|||||||
newCanvas.style.display = 'block';
|
newCanvas.style.display = 'block';
|
||||||
newCanvas.setAttribute("_left", x);
|
newCanvas.setAttribute("_left", x);
|
||||||
newCanvas.setAttribute("_top", y);
|
newCanvas.setAttribute("_top", y);
|
||||||
|
newCanvas.setAttribute("_width", width);
|
||||||
|
newCanvas.setAttribute("_height", height);
|
||||||
newCanvas.style.width = width * core.domStyle.scale + 'px';
|
newCanvas.style.width = width * core.domStyle.scale + 'px';
|
||||||
newCanvas.style.height = height * core.domStyle.scale + 'px';
|
newCanvas.style.height = height * core.domStyle.scale + 'px';
|
||||||
newCanvas.style.left = x * core.domStyle.scale + 'px';
|
newCanvas.style.left = x * core.domStyle.scale + 'px';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user