diff --git a/src/core/main/setting.ts b/src/core/main/setting.ts index d73aeaa..8b47944 100644 --- a/src/core/main/setting.ts +++ b/src/core/main/setting.ts @@ -356,17 +356,19 @@ function handleScreenSetting( 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') { // 勇士显伤