fix: 全屏切换

This commit is contained in:
unanmed 2024-03-12 18:04:37 +08:00
parent 95dc31329d
commit a16cbff049

View File

@ -356,17 +356,19 @@ function handleScreenSetting<T extends number | boolean>(
const beforeIsMobile = isMobile;
// 全屏
triggerFullscreen(n as boolean).then(() => {
if (beforeIsMobile) {
mainSetting.setValue(
'screen.fontSize',
Math.floor((fontSize * 2) / 3)
);
} else if (isMobile) {
mainSetting.setValue(
'screen.fontSize',
Math.floor((fontSize * 3) / 2)
);
}
requestAnimationFrame(() => {
if (beforeIsMobile) {
mainSetting.setValue(
'screen.fontSize',
Math.floor((fontSize * 2) / 3)
);
} else if (matchMedia('(max-width: 600px)').matches) {
mainSetting.setValue(
'screen.fontSize',
Math.floor((fontSize * 3) / 2)
);
}
})
});
} else if (key === 'heroDetail') {
// 勇士显伤