fix(layout): auto two-column layout for unfolded screen, closes #2588 (#2615)

This commit is contained in:
Huang Xin
2025-12-04 13:56:23 +08:00
committed by GitHub
parent a1487fd60c
commit fad7966fc4
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -1,13 +1,18 @@
import { ViewSettings } from '@/types/book';
export const getMaxInlineSize = (viewSettings: ViewSettings) => {
const isVertical = viewSettings.vertical!;
const isVertical = viewSettings.vertical;
const screenWidth = window.innerWidth;
const screenHeight = window.innerHeight;
return isVertical && false
const screenAspectRatio = isVertical ? screenHeight / screenWidth : screenWidth / screenHeight;
const isUnfoldedScreen = screenAspectRatio < 1.3 && screenAspectRatio > 0.77 && screenWidth > 600;
return isVertical
? Math.max(screenWidth, screenHeight, 720)
: viewSettings.maxInlineSize!;
: isUnfoldedScreen
? viewSettings.maxInlineSize * 0.8
: viewSettings.maxInlineSize;
};
export const getDefaultMaxInlineSize = () => {