Skip to content

fix: handle NaN layout widths#178

Open
hiSandog wants to merge 1 commit into
chenglou:mainfrom
hiSandog:fix/layout-input-width-20260518
Open

fix: handle NaN layout widths#178
hiSandog wants to merge 1 commit into
chenglou:mainfrom
hiSandog:fix/layout-input-width-20260518

Conversation

@hiSandog
Copy link
Copy Markdown
Contributor

Summary

  • Normalize NaN maxWidth inputs to zero before running public layout APIs
  • Keep layout(), layoutWithLines(), layoutNextLine(), layoutNextLineRange(), walkLineRanges(), and measureLineStats aligned for transient invalid width measurements
  • Add a regression test covering the NaN fallback behavior

Tests

  • bun test src/layout.test.ts
  • bun run check
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant