Skip to content

fix(core): cut the child at the box in vector DecoratedBox - #94

Merged
AsPulse merged 1 commit into
mainfrom
fix/vector-decorated-box-clip
Jul 29, 2026
Merged

AsPulse merged 1 commit into
mainfrom
fix/vector-decorated-box-clip

Conversation

@AsPulse

@AsPulse AsPulse commented Jul 29, 2026

Copy link
Copy Markdown
Member

The vector DecoratedBox reported only its own box as its paint bounds, which cuts an overflowing child while the box is the rasterization root but not once the box sits inside another vector container: a vector parent keeps its children's nodes and drops their view boxes, so the child's overflow simply paints on. The raster variant clips in either position, because it composites the child into a box-sized buffer. Separately, the vector variant's own border strokes the box outline, so half its width falls outside the box — and was cut off, the same omission #84 fixed for path shapes.

Change

  • Wrap an overflowing child in a ClipGroup at the box, so a DecoratedBox clips wherever it appears; a child that already fits emits the same node tree as before.
  • Include a visible border's conservative stroke outset in paint_bounds and render().view_box, since the border is the box's own paint rather than the child's.
  • Share rect_path_commands with Clip instead of rebuilding the box path.
  • Add unit coverage for the clip, the no-clip fast path, and the border outset, plus CPU rasterization regressions for a nested box cutting its child and for a border keeping its outer half.
  • Update the English and Japanese layout tutorials, which described the clip as raster-only.
  • Add a major changeset because the corrected clip and bounds can change existing rendered video pixels.

@AsPulse
AsPulse merged commit 85820d9 into main Jul 29, 2026
17 checks passed
@AsPulse
AsPulse deleted the fix/vector-decorated-box-clip branch July 29, 2026 14:07
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