perf(scene): extend viewport scissor to hatch / image / wipeout passes (Phase 1.4)
Wire pass already uses `WireModel.vp_scissor` to clip viewport-projected geometry to its paper-space viewport rect; hatch / image / wipeout passes drew across the whole canvas. When a future paper-space path projects fills/images into a viewport, they would bleed past the viewport frame. Add `vp_scissor: Option<[f32; 4]>` to HatchModel and ImageModel (mirroring WireModel), forward it through HatchGpu / ImageGpu, and add per-pass `compute_*_scissors` / `set_scissor_rect` machinery. Factored the wire-side scissor-projection math into a shared `project_scissor` helper. Field defaults to None at every constructor site — no producer sets it yet, so this is plumbing for the paper-viewport fill projection that Phase 1.4 unblocks without changing current visual output. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
9a4531bd8e
commit
fbbac423d4
8 changed files with 145 additions and 24 deletions
|
|
@ -2315,6 +2315,7 @@ impl Scene {
|
|||
color,
|
||||
angle_offset: 0.0,
|
||||
scale: 1.0,
|
||||
vp_scissor: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -2367,6 +2368,7 @@ impl Scene {
|
|||
color: fill_color,
|
||||
angle_offset: 0.0,
|
||||
scale: 1.0,
|
||||
vp_scissor: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -2658,6 +2660,7 @@ impl Scene {
|
|||
color,
|
||||
angle_offset: dxf.pattern_angle as f32,
|
||||
scale: dxf.pattern_scale as f32,
|
||||
vp_scissor: None,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -2806,6 +2809,7 @@ impl Scene {
|
|||
color,
|
||||
angle_offset: 0.0,
|
||||
scale: 1.0,
|
||||
vp_scissor: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue