mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
继续修复高清化
This commit is contained in:
parent
045400ecd6
commit
05fe01abfa
@ -2583,6 +2583,7 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (
|
|||||||
if (options.noHD) {
|
if (options.noHD) {
|
||||||
tempCanvas.canvas.width = width * 32 * scale;
|
tempCanvas.canvas.width = width * 32 * scale;
|
||||||
tempCanvas.canvas.height = height * 32 * scale;
|
tempCanvas.canvas.height = height * 32 * scale;
|
||||||
|
tempCanvas.canvas.removeAttribute('isHD');
|
||||||
} else
|
} else
|
||||||
core.resizeCanvas(
|
core.resizeCanvas(
|
||||||
tempCanvas,
|
tempCanvas,
|
||||||
@ -2591,12 +2592,12 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (
|
|||||||
false,
|
false,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
tempCanvas.scale(scale, scale);
|
|
||||||
} else if (width * height > core.bigmap.threshold) {
|
} else if (width * height > core.bigmap.threshold) {
|
||||||
options.v2 = true;
|
options.v2 = true;
|
||||||
if (options.noHD) {
|
if (options.noHD) {
|
||||||
tempCanvas.canvas.width = core._PX_;
|
tempCanvas.canvas.width = core._PX_;
|
||||||
tempCanvas.canvas.height = core._PY_;
|
tempCanvas.canvas.height = core._PY_;
|
||||||
|
tempCanvas.canvas.removeAttribute('isHD');
|
||||||
} else core.resizeCanvas(tempCanvas, core._PX_, core._PY_);
|
} else core.resizeCanvas(tempCanvas, core._PX_, core._PY_);
|
||||||
var centerX = options.centerX,
|
var centerX = options.centerX,
|
||||||
centerY = options.centerY;
|
centerY = options.centerY;
|
||||||
@ -2618,6 +2619,7 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (
|
|||||||
if (options.noHD) {
|
if (options.noHD) {
|
||||||
tempCanvas.canvas.width = width * 32;
|
tempCanvas.canvas.width = width * 32;
|
||||||
tempCanvas.canvas.height = height * 32;
|
tempCanvas.canvas.height = height * 32;
|
||||||
|
tempCanvas.canvas.removeAttribute('isHD');
|
||||||
} else
|
} else
|
||||||
core.resizeCanvas(tempCanvas, width * 32, height * 32, false, true);
|
core.resizeCanvas(tempCanvas, width * 32, height * 32, false, true);
|
||||||
}
|
}
|
||||||
@ -2756,6 +2758,7 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
|
|||||||
hw = hh = core.__HALF_SIZE__;
|
hw = hh = core.__HALF_SIZE__;
|
||||||
W = H = core.__SIZE__;
|
W = H = core.__SIZE__;
|
||||||
}
|
}
|
||||||
|
const scale = devicePixelRatio * core.domStyle.scale;
|
||||||
if (options.v2) {
|
if (options.v2) {
|
||||||
if (options.noHD) {
|
if (options.noHD) {
|
||||||
core.drawImage(
|
core.drawImage(
|
||||||
@ -2771,7 +2774,6 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
|
|||||||
h
|
h
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const scale = devicePixelRatio * core.domStyle.scale;
|
|
||||||
core.drawImage(
|
core.drawImage(
|
||||||
ctx,
|
ctx,
|
||||||
tempCanvas.canvas,
|
tempCanvas.canvas,
|
||||||
@ -2808,8 +2810,8 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
|
|||||||
tempCanvas.canvas,
|
tempCanvas.canvas,
|
||||||
offsetX * 32,
|
offsetX * 32,
|
||||||
offsetY * 32,
|
offsetY * 32,
|
||||||
pw,
|
pw * scale,
|
||||||
ph,
|
ph * scale,
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
w,
|
w,
|
||||||
|
@ -2763,10 +2763,9 @@ ui.prototype._drawChoices_getHorizontalPosition = function (
|
|||||||
for (var i = 0; i < choices.length; i++) {
|
for (var i = 0; i < choices.length; i++) {
|
||||||
if (typeof choices[i] === 'string') choices[i] = { text: choices[i] };
|
if (typeof choices[i] === 'string') choices[i] = { text: choices[i] };
|
||||||
choices[i].text = core.replaceText(choices[i].text);
|
choices[i].text = core.replaceText(choices[i].text);
|
||||||
choices[i].width = core.calWidth(
|
choices[i].width =
|
||||||
ctx,
|
core.calWidth(ctx, core.replaceText(choices[i].text)) /
|
||||||
core.replaceText(choices[i].text)
|
devicePixelRatio;
|
||||||
);
|
|
||||||
if (choices[i].icon != null) choices[i].width += 28;
|
if (choices[i].icon != null) choices[i].width += 28;
|
||||||
width = Math.max(width, choices[i].width + 30);
|
width = Math.max(width, choices[i].width + 30);
|
||||||
}
|
}
|
||||||
@ -3036,7 +3035,7 @@ ui.prototype.drawConfirmBox = function (text, yesCallback, noCallback, ctx) {
|
|||||||
);
|
);
|
||||||
core.fillText(ctx, '取消', core._PX_ / 2 + 38, rect.bottom - 35);
|
core.fillText(ctx, '取消', core._PX_ / 2 + 38, rect.bottom - 35);
|
||||||
if (core.status.event.selection != 'none') {
|
if (core.status.event.selection != 'none') {
|
||||||
var len = core.calWidth(ctx, '确定');
|
var len = core.calWidth(ctx, '确定') / devicePixelRatio;
|
||||||
var strokeLeft =
|
var strokeLeft =
|
||||||
core._PX_ / 2 +
|
core._PX_ / 2 +
|
||||||
(76 * core.status.event.selection - 38) -
|
(76 * core.status.event.selection - 38) -
|
||||||
@ -3519,7 +3518,7 @@ ui.prototype._drawViewMaps = function (index, x, y) {
|
|||||||
});
|
});
|
||||||
core.clearMap('data');
|
core.clearMap('data');
|
||||||
core.setTextAlign('data', 'left');
|
core.setTextAlign('data', 'left');
|
||||||
core.setFont('data', '16px Arial');
|
core.setFont('data', '20px normal');
|
||||||
var text = core.status.maps[data.floorId].title;
|
var text = core.status.maps[data.floorId].title;
|
||||||
if (!data.all && (data.mw > core._WIDTH_ || data.mh > core._HEIGHT_))
|
if (!data.all && (data.mw > core._WIDTH_ || data.mh > core._HEIGHT_))
|
||||||
text +=
|
text +=
|
||||||
@ -3531,7 +3530,7 @@ ui.prototype._drawViewMaps = function (index, x, y) {
|
|||||||
if (core.markedFloorIds[data.floorId]) text += ' (已标记)';
|
if (core.markedFloorIds[data.floorId]) text += ' (已标记)';
|
||||||
var textX = 16,
|
var textX = 16,
|
||||||
textY = 18,
|
textY = 18,
|
||||||
width = textX + core.calWidth('data', text) + 16,
|
width = textX + core.calWidth('data', text) / devicePixelRatio + 16,
|
||||||
height = 42;
|
height = 42;
|
||||||
core.fillRect('data', 5, 5, width, height, 'rgba(0,0,0,0.4)');
|
core.fillRect('data', 5, 5, width, height, 'rgba(0,0,0,0.4)');
|
||||||
core.fillText('data', text, textX + 5, textY + 15, 'rgba(255,255,255,0.6)');
|
core.fillText('data', text, textX + 5, textY + 15, 'rgba(255,255,255,0.6)');
|
||||||
|
Loading…
Reference in New Issue
Block a user