Implement row::Wrapping widget
If you have a `Row`, simply call `Row::wrap` at the end to turn it into a `Row` that will wrap its contents. The original alignment of the `Row` is preserved per row wrapped.
This commit is contained in:
parent
ff0da4dc81
commit
6fbbc30f5c
3 changed files with 211 additions and 9 deletions
|
|
@ -103,12 +103,13 @@ impl Node {
|
|||
}
|
||||
|
||||
/// Translates the [`Node`] by the given translation.
|
||||
pub fn translate(self, translation: impl Into<Vector>) -> Self {
|
||||
let translation = translation.into();
|
||||
pub fn translate(mut self, translation: impl Into<Vector>) -> Self {
|
||||
self.translate_mut(translation);
|
||||
self
|
||||
}
|
||||
|
||||
Self {
|
||||
bounds: self.bounds + translation,
|
||||
..self
|
||||
}
|
||||
/// Translates the [`Node`] by the given translation.
|
||||
pub fn translate_mut(&mut self, translation: impl Into<Vector>) {
|
||||
self.bounds = self.bounds + translation.into();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue