diff options
author | 2024-08-06 18:06:42 +0200 | |
---|---|---|
committer | 2024-08-06 18:06:42 +0200 | |
commit | d5ffe98ce939990e6c8ef6f40895cd1f9633fe18 (patch) | |
tree | ce165aa5f79750b1fe4d05f7380a92759014cef6 /core/src | |
parent | ff0da4dc819a0cb3037502fd2ee82609f25f2fe9 (diff) | |
parent | 6fbbc30f5cb1f699c61e064ed54fe428d96be7d3 (diff) | |
download | iced-d5ffe98ce939990e6c8ef6f40895cd1f9633fe18.tar.gz iced-d5ffe98ce939990e6c8ef6f40895cd1f9633fe18.tar.bz2 iced-d5ffe98ce939990e6c8ef6f40895cd1f9633fe18.zip |
Merge pull request #2539 from iced-rs/feature/row-wrapping
Implement `row::Wrapping` widget
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/layout/node.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/layout/node.rs b/core/src/layout/node.rs index 5743a9bd..0c0f90fb 100644 --- a/core/src/layout/node.rs +++ b/core/src/layout/node.rs @@ -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(); } } |