Revert changing the constructor and implement new method.

This commit is contained in:
daxpedda 2020-02-14 21:41:35 +01:00
parent 60b40fdc99
commit f4b8bce837
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F
16 changed files with 39 additions and 44 deletions

View file

@ -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,
)
}