mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 16:06:09 +00:00
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:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user