Tests: floated panel bodies stay within the requested width

The narrow-panel row tests compared each control with the floating
panel's body but never checked the body itself, so a body wider than
the requested width would let controls past the panel edge pass.
floated() now asserts the body is no wider than the width the float
asked for.
This commit is contained in:
dotCooCoo
2026-11-25 09:35:53 -08:00
parent 2b075e5a9a
commit edc0a6da50
@@ -60,6 +60,7 @@ fn floated(panel: &str, lang: &str, width: f32, names: &[&str]) -> (egui::Rect,
.filter(|(_, n)| n.role() == Role::TabPanel)
.find_map(|(_, n)| rect(n).filter(|r| (r.left() - AT).abs() < 1.0))
.unwrap_or_else(|| panic!("{panel} does not float at x {AT}"));
assert!(body.width() <= width + 1.0, "{panel}'s body {body:?} is wider than the {width} the float asked for");
let controls = shown
.into_iter()
.map(|name| {