Relayout UserInterface on resize in iced_winit

This commit is contained in:
Héctor Ramón Jiménez 2020-11-05 02:11:11 +01:00
parent 86b26f65d6
commit 88993fb092
3 changed files with 59 additions and 17 deletions

View file

@ -388,6 +388,23 @@ where
}
}
/// Relayouts and returns a new [`UserInterface`] using the provided
/// bounds.
///
/// [`UserInterface`]: struct.UserInterface.html
pub fn relayout(self, bounds: Size, renderer: &mut Renderer) -> Self {
Self::build(
self.root,
bounds,
Cache {
base: self.base,
overlay: self.overlay,
bounds: self.bounds,
},
renderer,
)
}
/// Extract the [`Cache`] of the [`UserInterface`], consuming it in the
/// process.
///