Skip to content

feat: multiline text with word-wrapping and leading control#68

Open
eugenioenko wants to merge 1 commit into
mainfrom
feat/multiline-text
Open

feat: multiline text with word-wrapping and leading control#68
eugenioenko wants to merge 1 commit into
mainfrom
feat/multiline-text

Conversation

@eugenioenko
Copy link
Copy Markdown
Owner

Summary

  • Replace Two.Text with twojs-multiline-text library for proper multiline rendering
  • Hard line breaks: Shift+Enter in the text overlay creates \n breaks that render correctly
  • Word-wrapping: Drag-to-create text boxes wrap text at the boundary via the library's width property
  • Leading control: New slider in text toolbar (0.8–3.0) and properties panel for selected text
  • Backward compatible — old single-line text loads with default leading (1.3)

Known issue

Minor vertical text shift (~2-8px depending on font size) on commit — pre-existing issue caused by CSS vs SVG baseline model differences, not a regression from this change.

Test plan

  • Click canvas → type single-line → renders correctly
  • Click canvas → Shift+Enter → multiline renders with line breaks
  • Drag a text box → type long text → word-wraps at boundary
  • Change leading in toolbar → new text uses updated leading
  • Select text → change leading in properties panel → text re-renders
  • Reload page → persisted text loads correctly (including multiline)
  • Old single-line text from before the change still loads fine

🤖 Generated with Claude Code

Replace Two.js Text with twojs-multiline-text library for proper
multiline rendering. Shift+Enter creates hard line breaks, and
drag-to-create text boxes word-wrap at the boundary. Add leading
(line height) control to both the text toolbar and properties panel.

Backward compatible — old single-line text loads with default leading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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