From 28a30de15d9d69e7107010c63155517648284424 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 11 Jun 2026 18:10:47 +0300 Subject: [PATCH] fix(wipeout): close rectangular fill loop so the mask stops bleeding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/scene/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scene/mod.rs b/src/scene/mod.rs index 11ebb64a6..3f5973a4e 100644 --- a/src/scene/mod.rs +++ b/src/scene/mod.rs @@ -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], ] } }