Relayout UserInterface on resize in iced_winit
This commit is contained in:
parent
86b26f65d6
commit
88993fb092
3 changed files with 59 additions and 17 deletions
|
|
@ -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.
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue