Fix subtract overflow

This commit is contained in:
Ian Douglas Scott 2024-01-26 13:04:58 -08:00
parent 2b3773c88e
commit d50c1f13f6

View file

@ -74,7 +74,7 @@ impl<'a, Msg> Widget<Msg, cosmic::Renderer> for Toplevels<'a, Msg> {
let spacing = 16;
// Get total requested main axis length if widget could have all the space
let total_spacing = spacing * (self.children.len() - 1).max(0);
let total_spacing = spacing * (self.children.len().saturating_sub(1)).max(0);
let requested_mains = self
.children
.iter()