fix:高清画面

This commit is contained in:
ShakeFlower 2025-02-27 09:03:41 +08:00
parent d379b9d419
commit 11575c683a
2 changed files with 8 additions and 15 deletions

View File

@ -1874,22 +1874,17 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
}
else {
// 只绘制可见窗口
// drawSize:默认为1楼传和SL界面单独判定意义不明有待研究
const drawSize = options.drawSize || 1;
const [pw, ph] = [core.__PIXELS__, core.__PIXELS__],
[hw, hh] = [core.__HALF_SIZE__, core.__HALF_SIZE__],
[W, H] = [core.__SIZE__, core.__SIZE__],
[w, h] = [core.__PIXELS__ * drawSize, core.__PIXELS__ * drawSize];
const pxs = core.__PIXELS__;
if (options.v2) {
if (options.noHD) core.drawImage(ctx, tempCanvas.canvas, 0, 0, pw, ph, x, y, w, h);
else core.drawImage(ctx, tempCanvas.canvas, 0, 0, pw * scale, ph * scale, x, y, w, h);
if (options.noHD) core.drawImage(ctx, tempCanvas.canvas, 0, 0, pxs, pxs, x, y, size, size);
else core.drawImage(ctx, tempCanvas.canvas, 0, 0, pxs * scale, pxs * scale, x, y, size, size);
} else {
const offsetX = core.clamp(centerX - hw, 0, width - W),
offsetY = core.clamp(centerY - hh, 0, height - H);
const offsetX = core.clamp(centerX - core.__HALF_SIZE__, 0, width - core.__SIZE__),
offsetY = core.clamp(centerY - core.__HALF_SIZE__, 0, height - core.__SIZE__);
if (options.noHD) {
core.drawImage(ctx, tempCanvas.canvas, offsetX * 32, offsetY * 32, pw, ph, x, y, w, h);
core.drawImage(ctx, tempCanvas.canvas, offsetX * 32, offsetY * 32, pxs, pxs, x, y, size, size);
} else {
core.drawImage(ctx, tempCanvas.canvas, offsetX * 32 * scale, offsetY * 32 * scale, pw * scale, ph * scale, x, y, w, h);
core.drawImage(ctx, tempCanvas.canvas, offsetX * 32 * scale, offsetY * 32 * scale, pxs * scale, pxs * scale, x, y, size, size);
}
}
}

View File

@ -2578,8 +2578,7 @@ ui.prototype.drawFly = function (page) {
}
var size = this.PIXEL - 143;
core.strokeRect('ui', 20, 100, size, size, '#FFFFFF', 2);
core.drawThumbnail(floorId, null, { ctx: 'ui', x: 20, y: 100, size: size, damage: true, drawSize: 0.6 });
// 好像是无法理解的魔数,有待将来研究及优化
core.drawThumbnail(floorId, null, { ctx: 'ui', x: 20, y: 100, size: size, damage: true });
}
////// 绘制中心对称飞行器
@ -3094,7 +3093,6 @@ ui.prototype._drawSLPanel_drawRecord = function (title, data, x, y, size, cho, h
core.drawThumbnail(data.floorId, map.blocks, {
heroLoc: data.hero.loc, heroIcon: data.hero.image, flags: data.hero.flags,
ctx: 'ui', x: x - size / 2, y: y + 15, size: size, centerX: data.hero.loc.x, centerY: data.hero.loc.y, noHD: true,
drawSize: 0.285, // 完全无法理解的魔数
});
if (core.isPlaying() && core.getFlag("hard") != data.hero.flags.hard) {
core.fillRect('ui', x - size / 2, y + 15, size, size, [0, 0, 0, 0.4]);