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/node.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'native/src/layout/node.rs') diff --git a/native/src/layout/node.rs b/native/src/layout/node.rs index fae6e330..e9885725 100644 --- a/native/src/layout/node.rs +++ b/native/src/layout/node.rs @@ -12,19 +12,19 @@ impl Node { /// /// [`Node`]: struct.Node.html /// [`Size`]: ../struct.Size.html - pub fn new(size: Size) -> Self { - Self::with_children(size, Vec::new()) + pub fn new(size: Size, bound: Size) -> Self { + Self::with_children(size, bound, Vec::new()) } /// Creates a new [`Node`] with the given [`Size`] and children. /// /// [`Node`]: struct.Node.html /// [`Size`]: ../struct.Size.html - pub fn with_children(size: Size, children: Vec) -> Self { + pub fn with_children(size: Size, bound: Size, children: Vec) -> Self { Node { bounds: Rectangle { - x: 0.0, - y: 0.0, + x: bound.width, + y: bound.height, width: size.width, height: size.height, }, -- cgit