forked from 1b-agent/opencadstudio-upstream
fix(wipeout): close rectangular fill loop so the mask stops bleeding
The GPU in_polygon ray-cast walks sequential boundary pairs and never wraps last→first, so it needs an explicit closing vertex. The polygon fill branch already appends one, but the rectangular branch returned a bare 4-corner quad — the v3→v0 (left) edge went untested and the solid mask bled past the boundary. Newly created wipeouts take this branch, so the fill rendered wider than the clicked box while the border/grips (drawn as wires) stayed correct. Repeat corner 0 to close the loop. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
ece5d50796
commit
28a30de15d
1 file changed
+5
@@ -3870,11 +3870,16 @@ impl Scene {
|
||||
let vx = (wo.v_vector.x * wo.size.y) as f32;
|
||||
let vy = (wo.v_vector.y * wo.size.y) as f32;
|
||||
let _ = oz;
|
||||
// Close the loop (repeat corner 0): the GPU `in_polygon` ray-cast
|
||||
// walks sequential vertex pairs and never wraps last→first, so an
|
||||
// unclosed quad leaves the v3→v0 edge untested and the solid mask
|
||||
// bleeds past the boundary — same reason the polygon branch closes.
|
||||
vec![
|
||||
[ox, oy],
|
||||
[ox + ux, oy + uy],
|
||||
[ox + ux + vx, oy + uy + vy],
|
||||
[ox + vx, oy + vy],
|
||||
[ox, oy],
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user