Skip to content

Fix clipping in recording replay#1569

Merged
LaurenzV merged 3 commits into
linebender:mainfrom
AdrianEddy:main
Apr 14, 2026
Merged

Fix clipping in recording replay#1569
LaurenzV merged 3 commits into
linebender:mainfrom
AdrianEddy:main

Conversation

@AdrianEddy
Copy link
Copy Markdown
Contributor

generate_strips_from_commands (used by prepare_recording) was passing None for the clip path to the strip generator, while the live draw paths (fill_path, stroke_path) pass the active scissor clip.
This caused recorded geometry inside a push_clip_path scope to render unclipped on replay.

This PR fixes that by adding current_clip_path() to the Dispatcher trait and querying it per-command in the strip generation loop. A recording_inside_clip regression test covers both FillRect and FillPath commands inside a clip scope, verifying geometry is clipped to the scissor rect.

The bug was introduced in #1203.

I think a deeper issue is that clip paths are not part of the recording, but I'm not sure they should be, so I'm keeping this PR minimal

Comment thread sparse_strips/vello_sparse_tests/tests/recording.rs Outdated
@LaurenzV LaurenzV enabled auto-merge April 14, 2026 13:30
@LaurenzV
Copy link
Copy Markdown
Collaborator

Thanks!

@LaurenzV LaurenzV added this pull request to the merge queue Apr 14, 2026
Merged via the queue into linebender:main with commit 25d8912 Apr 14, 2026
17 checks 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.

2 participants