Skip to content

Commit

Permalink
Fix default node size
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef committed Aug 23, 2020
1 parent 022a31f commit 9554105
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions crates/bevy_ui/src/flex/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,25 @@ where
}
}

fn from_size<T, U>(size: Size<U>) -> stretch::geometry::Size<T>
fn from_size<T>(size: Size<Val>) -> stretch::geometry::Size<T>
where
T: From<U>,
T: From<Val>,
{
let width = if let Val::Undefined = size.width {
Val::Auto
} else {
size.width
};

let height = if let Val::Undefined = size.height {
Val::Auto
} else {
size.height
};

stretch::geometry::Size {
width: size.width.into(),
height: size.height.into(),
width: width.into(),
height: height.into(),
}
}

Expand Down

0 comments on commit 9554105

Please sign in to comment.