From 4cba9cd65a0ec50baf3984032c62b17f67fe9dbd Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 28 Nov 2026 05:16:49 +0100 Subject: [PATCH] layout tests: the offered room reaches the measure in logical px --- crates/thing-core/tests/layout.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/thing-core/tests/layout.rs b/crates/thing-core/tests/layout.rs index df7a8f8..795e7ee 100644 --- a/crates/thing-core/tests/layout.rs +++ b/crates/thing-core/tests/layout.rs @@ -474,13 +474,13 @@ fn item_alignment_and_content_arms() { #[test] fn available_space_is_logical() { - // A shrink-to-fit box wraps its text at the room it is offered: 100 logical px at any scale. - let wrapped = BoxStyle { size: size2(Dimension::Content, Dimension::Auto), ..plain() }; + // A text leaf that is not stretched wraps at the room it is offered: 100 logical px at any + // scale, which holds twelve 8 px characters. let column = BoxStyle { direction: Direction::Column, align_items: ItemAlign::Start, ..sized(100.0, 600.0) }; - let root = bx("root", column, vec![bx("wrap", wrapped, vec![text("t", &"xxxx ".repeat(10))])]); + let root = bx("root", column, vec![text("t", &"xxxx ".repeat(10))]); for scale in [1.0, 2.0] { let laid = lay_with(&mut MemState::new(), root.clone(), &pixels(800.0, 600.0, scale)); - assert_eq!(rect(&laid, "wrap").2, 100.0 * scale); + assert_eq!(rect(&laid, "t").2, 96.0 * scale); } }