fix(control): unbounded entities no longer overflow the capture candidate area

An XLINE or RAY projects to saturated i32 corners; their difference
overflowed and panicked the debug build on every capture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-02 00:08:55 +03:00
1 parent f08eb77b97
commit 8c1471078d
1 file changed
+4 -1
+4 -1
View File
@@ -254,7 +254,10 @@ pub(crate) fn compute_grounding(
s_max_y = y0.max(y1);
}
let area = ((s_max_x - s_min_x).abs() * (s_max_y - s_min_y).abs()) as f32;
// An unbounded entity (XLINE, RAY) projects to saturated i32
// corners, whose difference overflows i32.
let width = (f64::from(s_max_x) - f64::from(s_min_x)).abs();
let area = (width * (f64::from(s_max_y) - f64::from(s_min_y)).abs()) as f32;
let selected = selected_set.contains(&handle);
let layer = entity.common().layer.clone();