ITADN

[sparse_strips]: Incorrect dash rendering

#482Opengrebmeg 创建于 2025-07-09
bug
G
grebmegcommented
**Project**: Vello Sparse Strips ### Description I haven’t looked into this problem in depth yet, but there’s incorrect rendering when dash patterns are used with certain stroke widths and dash pattern values. ### Steps to Reproduce 1. Copy and paste the test below into the `vello_sparse_strips` test suite 2. Run the test individually 3. Observe the newly generated snapshot ```rust #[vello_test(width = 120, height = 120)] fn stroke_dash_pattern_issue(ctx: &mut impl Renderer) { let rect = Rect::new(0.0, 0.0, 80.0, 80.0); ctx.set_transform(Affine::translate((20.0, 20.0))); ctx.set_paint(REBECCA_PURPLE); ctx.set_stroke(Stroke { width: 20.0, join: Join::Miter, miter_limit: 4.0, start_cap: Cap::Butt, end_cap: Cap::Butt, dash_offset: 0.0, dash_pattern: SmallVec::from_vec(vec![73.0, 12.0]), }); ctx.stroke_rect(&rect); } ``` ### Expected Behavior - Dashes should render consistently and align correctly ### Actual Behavior - Parts of the path are not rendered as expected <img width="464" height="464" alt="Image" src="https://github.com/user-attachments/assets/dc01225c-9550-4992-99f0-ae6caebde003" />
3 条评论