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; const beforeIsMobile = isMobile;
// 全屏 // 全屏
triggerFullscreen(n as boolean).then(() => { triggerFullscreen(n as boolean).then(() => {
if (beforeIsMobile) { requestAnimationFrame(() => {
mainSetting.setValue( if (beforeIsMobile) {
'screen.fontSize', mainSetting.setValue(
Math.floor((fontSize * 2) / 3) 'screen.fontSize',
); Math.floor((fontSize * 2) / 3)
} else if (isMobile) { );
mainSetting.setValue( } else if (matchMedia('(max-width: 600px)').matches) {
'screen.fontSize', mainSetting.setValue(
Math.floor((fontSize * 3) / 2) 'screen.fontSize',
); Math.floor((fontSize * 3) / 2)
} );
}
})
}); });
} else if (key === 'heroDetail') { } else if (key === 'heroDetail') {
// 勇士显伤 // 勇士显伤