Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63ed2ed950
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const rawTopMargin = | ||
| headerContentHeight > 0 ? Math.max(baseTopMargin, currentHeaderDistance + headerContentHeight) : baseTopMargin; | ||
| const minimumContentHeight = 1; | ||
| const maxAllowedTopMargin = pageHeight - effectiveBottomMargin - minimumContentHeight; | ||
| return Math.min(rawTopMargin, maxAllowedTopMargin); |
There was a problem hiding this comment.
Keep non-header pages from silently mutating margins
calculateEffectiveTopMargin now caps rawTopMargin against pageHeight - effectiveBottomMargin even when there is no header content, so configurations where top + bottom exceeds page height no longer trigger the existing non-positive-content-area failure path and instead silently rewrite the top margin. This changes layout semantics for explicit user/document margins (and can produce negative top margins when bottom alone exceeds page height), so the cap should be limited to header-inflation scenarios or otherwise preserve the invalid-margin validation behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
added calculations for bottom margin in order to not exceed page
c2dceb5 to
1b3fa23
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
No description provided.