From a0c94c1884bafb3ba7cc3eec968448fa5ae3ecca Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 9 Mar 2024 19:59:38 +0100 Subject: [PATCH] Fix layout issues The issues were likely caused by floating point inaccuracy. I don't have a minimal working example though. --- showbits-thermal-printer/src/drawer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/showbits-thermal-printer/src/drawer.rs b/showbits-thermal-printer/src/drawer.rs index 644ccd6..e58372c 100644 --- a/showbits-thermal-printer/src/drawer.rs +++ b/showbits-thermal-printer/src/drawer.rs @@ -140,7 +140,6 @@ impl Drawer { .node() .with_border_all(length(1.0)) .with_padding_horiz(length(1.0)) - .with_margin_right(length(4.0)) .with_flex_shrink(0.0) // Avoid wrapping .and_child(username) .register(&mut tree)?; @@ -178,9 +177,10 @@ impl Drawer { let root = Node::empty() .with_size_width(percent(1.0)) - .with_padding_vert(length(1.0)) + .with_padding_all(length(1.0)) .with_flex_direction(FlexDirection::Row) .with_align_items(Some(AlignItems::Start)) + .with_gap_width(length(2.0)) .and_child(username) .and_child(content) .register(&mut tree)?;