feat: add a text layout engine, the bb with text wrapping and h/v adj…#37
feat: add a text layout engine, the bb with text wrapping and h/v adj…#37PlkMarudny wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughText clips now support resizable boxes, horizontal and vertical alignment, wrapping, scale-to-fit sizing, box-aware rendering, and justified word-animation spacing. The inspector, canvas interactions, default properties, documentation, and rendering pipeline are updated accordingly. ChangesText box layout
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Canvas
participant TextClip
participant drawText
User->>Canvas: drag text selection corner
Canvas->>TextClip: update boxW, boxH, x, y
TextClip->>drawText: provide box and alignment properties
drawText->>Canvas: render wrapped and positioned text
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app.js`:
- Around line 3190-3234: Declare or compute the font weight within drawText
before the font-cut branch uses it, reusing the same weight value expected by
setTextFont. Ensure the font-cut path no longer references setTextFont’s local
weight and cannot throw a ReferenceError.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d2516fe8-de33-4990-83bb-1bf7b1184cfd
📒 Files selected for processing (3)
CLAUDE.mdREADME.mdapp.js
What does this PR do?
Text layout engine (that's a bold term) has been added. Now the text bounding box can be set with the fixed font size, and the text inside can be justified in both directions. Technically, it is a word-wrap feature, with the possibility to adjust text horizontally and vertically within the textbox (or a bounding box, whatever terminology is preferred).
Such a feature allows setting a kind of a "templated project" (it will be a separated PR) delivering text content that will be reasonably placed within a composition. I guess for an agent it will be also easy to produce a predictable output, like with a prompt like "take a video clip clipname , set a title to "Orange of course" and the text content to "Orange cat usual behaviour", where "text content" refers to the predefined textbox with a fixed font size.
Closes #
Type of change
How was it verified?
node --check server.js && node --check app.js && node --check mcp-server.jspassesCLAUDE.md/README.mdif the schema, props, or API changedChecklist
Summary by CodeRabbit
New Features
Documentation