修复最大化放缩

This commit is contained in:
unanmed 2023-04-21 11:53:21 +08:00
parent 0a0de2aed3
commit aad0430103
2 changed files with 20 additions and 21 deletions

View File

@ -334,29 +334,28 @@ main.prototype.init = async function (mode, callback) {
main.core = core;
// 自动放缩最大化
const auto = core.getLocalStorage('autoScale');
let auto = core.getLocalStorage('autoScale');
if (auto == null) {
core.setLocalStorage('autoScale', true);
auto = true;
}
if (auto && !core.domStyle.isVertical) {
try {
core.plugin.utils.maxGameScale();
if (!core.getLocalStorage('fullscreen', false)) {
requestAnimationFrame(() => {
var style = getComputedStyle(main.dom.gameGroup);
var height = parseFloat(style.height);
if (height > window.innerHeight * 0.95) {
core.control.setDisplayScale(-1);
if (!core.isPlaying() && core.flags.enableHDCanvas) {
core.domStyle.ratio = Math.max(
window.devicePixelRatio || 1,
core.domStyle.scale
);
core.resize();
}
requestAnimationFrame(() => {
var style = getComputedStyle(main.dom.gameGroup);
var height = parseFloat(style.height);
if (height > window.innerHeight * 0.95) {
core.control.setDisplayScale(-1);
if (!core.isPlaying() && core.flags.enableHDCanvas) {
core.domStyle.ratio = Math.max(
window.devicePixelRatio || 1,
core.domStyle.scale
);
core.resize();
}
});
}
}
});
} catch {}
}
};

View File

@ -80,18 +80,18 @@ main.floors.MT47=
"cannotMoveIn": {},
"map": [
[ 0, 0,70030, 0, 0, 0,604, 91,604,70029,70029,70029,70029, 0, 0],
[ 0, 0,70030, 0,70031, 0,604, 0,604, 0, 0, 0,70028,70030,70030],
[ 0, 0,70030, 0,70031, 0,604,468,604, 0, 0, 0,70028,70030,70030],
[70030,70030,70030,70031,70031,70031,604,608,604,70028,70028,70028,70028, 0, 0],
[ 0, 0, 0,70031, 0, 0,611, 85,611, 0, 0, 0,70029,70029,70029],
[70031, 0, 0, 0, 0,613, 0, 0, 0, 0,604,643, 0, 0,604],
[70031,586,586,586,586,586,602,604,608,604,604, 0,604, 0,604],
[70031, 0, 0,494, 32,586, 0,604, 0,602, 0, 0,604, 0,604],
[70031, 0, 0,585,592, 0, 0,604, 0,587,587,587,587,587,587],
[ 0,617,585,585,492,586,586,586, 0,587,587, 0,492,482,587],
[ 0, 0,611, 0, 0, 0, 0,492, 0, 0,602, 0,587,482,587],
[ 0,617,585,585,492,586,586,586,378,587,587, 0,492,482,587],
[ 0, 0,611, 0,376, 0, 0,492, 0, 0,602, 0,587,482,587],
[ 0,643,584,584,584,614,584,584,584,600,584,608,585,585,585],
[70029, 0, 0, 0,584, 0, 0,584, 0, 0,584, 0, 0, 0,585],
[70029, 0, 0, 0,584, 0, 0,643, 0, 0,584, 0, 0, 0,585],
[70029, 0, 0, 0,584,376, 0,584, 0,378,584, 0, 0, 0,585],
[70029, 0, 0, 0,584, 34,381,643,381, 34,584, 0, 0, 0,585],
[70029,584,584,584,584,584,584, 0,584,584,584,584,584,584,584],
[70029, 0, 0, 0, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0]
],