From c39fd5103fbcf2b1184cf653b586ce6eecbb5792 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Wed, 29 May 2024 23:30:03 +0200 Subject: [PATCH] fix(grid): use content_size as size of widget's root node --- src/widget/grid/layout.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/widget/grid/layout.rs b/src/widget/grid/layout.rs index 9a19301..d61d13c 100644 --- a/src/widget/grid/layout.rs +++ b/src/widget/grid/layout.rs @@ -75,7 +75,7 @@ pub fn resolve( match leaf { Ok(leaf) => leafs.push(leaf), Err(why) => { - tracing::error!(%why, "cannot add leaf node to grid"); + tracing::error!(?why, "cannot add leaf node to grid"); continue; } } @@ -134,7 +134,7 @@ pub fn resolve( let root = match root { Ok(root) => root, Err(why) => { - tracing::error!(%why, "grid root style invalid"); + tracing::error!(?why, "grid root style invalid"); return Node::new(Size::ZERO); } }; @@ -146,14 +146,14 @@ pub fn resolve( height: length(max_size.height), }, ) { - tracing::error!(%why, "grid layout did not compute"); + tracing::error!(?why, "grid layout did not compute"); return Node::new(Size::ZERO); } let grid_layout = match taffy.layout(root) { Ok(layout) => layout, Err(why) => { - tracing::error!(%why, "cannot get layout of grid"); + tracing::error!(?why, "cannot get layout of grid"); return Node::new(Size::ZERO); } }; @@ -183,8 +183,8 @@ pub fn resolve( } let grid_size = Size { - width: grid_layout.size.width, - height: grid_layout.size.height, + width: grid_layout.content_size.width, + height: grid_layout.content_size.height, }; Node::with_children(grid_size.expand(padding), nodes)