From b72bd0b2b5c9c2a5c3f508a13ad9578169046a36 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Fri, 14 Feb 2020 15:57:07 +0100 Subject: Add `bound` to `Node` constructor. --- native/src/layout/flex.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'native/src/layout/flex.rs') diff --git a/native/src/layout/flex.rs b/native/src/layout/flex.rs index bd37b75a..02037b14 100644 --- a/native/src/layout/flex.rs +++ b/native/src/layout/flex.rs @@ -174,6 +174,7 @@ where Node::with_children( Size::new(size.width + padding * 2.0, size.height + padding * 2.0), + Size::ZERO, nodes, ) } -- cgit From f4b8bce837513cdd06df3a3ceba86fd9256d3cc5 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Fri, 14 Feb 2020 21:41:35 +0100 Subject: Revert changing the constructor and implement new method. --- native/src/layout/flex.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'native/src/layout/flex.rs') diff --git a/native/src/layout/flex.rs b/native/src/layout/flex.rs index 02037b14..2f65f1c1 100644 --- a/native/src/layout/flex.rs +++ b/native/src/layout/flex.rs @@ -18,7 +18,7 @@ // limitations under the License. use crate::{ layout::{Limits, Node}, - Align, Element, Size, + Align, Element, Point, Size, }; /// The main axis of a flex layout. @@ -152,8 +152,7 @@ where let (x, y) = axis.pack(main, padding); - node.bounds.x = x; - node.bounds.y = y; + node.move_to(Point::new(x, y)); match axis { Axis::Horizontal => { @@ -174,7 +173,6 @@ where Node::with_children( Size::new(size.width + padding * 2.0, size.height + padding * 2.0), - Size::ZERO, nodes, ) } -- cgit