Skip to content

Commit

Permalink
Fix benchmarks
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns committed Dec 26, 2024
1 parent d8f686f commit 00600b9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions benches/src/yoga_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ fn set_node_children(tree: &mut yg::YogaTree, node_id: yg::DefaultKey, children:
}

fn into_yg_units(dim: impl Into<tf::Dimension>) -> yg::StyleUnit {
match dim.into() {
tf::Dimension::Auto => yg::StyleUnit::Auto,
tf::Dimension::Length(val) => yg::StyleUnit::Point(yg::OrderedFloat(val)),
tf::Dimension::Percent(val) => yg::StyleUnit::Percent(yg::OrderedFloat(val)),
let dim : tf::Dimension = dim.into();
let val = dim.raw().value();
match dim.raw().tag() {
tf::CompactLength::AUTO_TAG => yg::StyleUnit::Auto,
tf::CompactLength::LENGTH_TAG => yg::StyleUnit::Point(yg::OrderedFloat(val)),
tf::CompactLength::PERCENT_TAG => yg::StyleUnit::Percent(yg::OrderedFloat(val)),
}
}

Expand Down

0 comments on commit 00600b9

Please sign in to comment.