fix(reader): let page margins shrink into the safe-area inset (#4761) (#5001)

This commit is contained in:
Huang Xin
2026-07-08 02:31:01 +09:00
committed by GitHub
parent a8d3411203
commit 0c24aad606
16 changed files with 274 additions and 42 deletions
@@ -614,7 +614,9 @@ const LayoutPanel: React.FC<SettingsPanelPanelProp> = ({ bookKey, onRegisterRese
value={showHeader && !isVertical ? marginTopPx : compactMarginTopPx}
onChange={showHeader && !isVertical ? setMarginTopPx : setCompactMarginTopPx}
min={
showHeader && !isVertical ? Math.max(0, Math.round((16 - gridInsets.top) / 4) * 4) : 0
showHeader && !isVertical
? Math.max(0, Math.round((16 - gridInsets.top) / 4) * 4) - gridInsets.top
: 0
}
max={88}
step={4}
@@ -625,7 +627,7 @@ const LayoutPanel: React.FC<SettingsPanelPanelProp> = ({ bookKey, onRegisterRese
onChange={showFooter && !isVertical ? setMarginBottomPx : setCompactMarginBottomPx}
min={
showFooter && !isVertical
? Math.max(0, Math.round((16 - gridInsets.bottom) / 4) * 4)
? Math.max(0, Math.round((16 - gridInsets.bottom) / 4) * 4) - gridInsets.bottom
: 0
}
max={88}