fix:高清画面
This commit is contained in:
parent
d379b9d419
commit
11575c683a
19
libs/maps.js
19
libs/maps.js
@ -1874,22 +1874,17 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// 只绘制可见窗口
|
// 只绘制可见窗口
|
||||||
// drawSize:默认为1,楼传和SL界面单独判定,意义不明,有待研究
|
const pxs = core.__PIXELS__;
|
||||||
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];
|
|
||||||
if (options.v2) {
|
if (options.v2) {
|
||||||
if (options.noHD) core.drawImage(ctx, tempCanvas.canvas, 0, 0, pw, ph, 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, pw * scale, ph * scale, x, y, w, h);
|
else core.drawImage(ctx, tempCanvas.canvas, 0, 0, pxs * scale, pxs * scale, x, y, size, size);
|
||||||
} else {
|
} else {
|
||||||
const offsetX = core.clamp(centerX - hw, 0, width - W),
|
const offsetX = core.clamp(centerX - core.__HALF_SIZE__, 0, width - core.__SIZE__),
|
||||||
offsetY = core.clamp(centerY - hh, 0, height - H);
|
offsetY = core.clamp(centerY - core.__HALF_SIZE__, 0, height - core.__SIZE__);
|
||||||
if (options.noHD) {
|
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 {
|
} 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2578,8 +2578,7 @@ ui.prototype.drawFly = function (page) {
|
|||||||
}
|
}
|
||||||
var size = this.PIXEL - 143;
|
var size = this.PIXEL - 143;
|
||||||
core.strokeRect('ui', 20, 100, size, size, '#FFFFFF', 2);
|
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, {
|
core.drawThumbnail(data.floorId, map.blocks, {
|
||||||
heroLoc: data.hero.loc, heroIcon: data.hero.image, flags: data.hero.flags,
|
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,
|
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) {
|
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]);
|
core.fillRect('ui', x - size / 2, y + 15, size, size, [0, 0, 0, 0.4]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user