Skip to content

Preserve consecutive spaces in text objects#87

Merged
mucow24 merged 1 commit into
mainfrom
claude/loving-moser-db3a4a
Apr 29, 2026
Merged

Preserve consecutive spaces in text objects#87
mucow24 merged 1 commit into
mainfrom
claude/loving-moser-db3a4a

Conversation

@mucow24
Copy link
Copy Markdown
Owner

@mucow24 mucow24 commented Apr 29, 2026

Summary

  • Pixi text style was whiteSpace: 'pre-line', which collapses runs of whitespace into a single space. Switched to 'pre' so multiple spaces actually push text. (wordWrap: true is independent and still wraps to the box width.)
  • Updated measureWordWrappedTextHeight to tokenize paragraphs into whitespace + word runs so the measured line count matches what the renderer draws.
  • Set wrap="off" on the inspector's text-content textarea so it scrolls horizontally instead of soft-wrapping while editing. Hard newlines (Enter) still preserved.

Test plan

  • Create a text object, type a b (multiple spaces) — spaces preserved on canvas
  • Long content in inspector textarea — scrolls horizontally, no soft wrap
  • Multi-line content with long lines — canvas word wrap still works at box width
  • Lint + typecheck pass
  • e2e suite: ran full suite, then --last-failed twice; all flake-only failures (ERR_CONNECTION_REFUSED cascades), final retry green

🤖 Generated with Claude Code

Pixi text style was using `whiteSpace: 'pre-line'`, which collapses runs
of whitespace into a single space. Switch to `'pre-wrap'` so multiple
spaces actually push text. The wrap-height measurement now tokenizes
paragraphs into whitespace + word runs to match the renderer.

Also set `wrap="off"` on the inspector's text-content textarea so it
scrolls horizontally instead of soft-wrapping while editing.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@mucow24 mucow24 merged commit d5bbe3c into main Apr 29, 2026
1 check passed
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