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

@ -7,7 +7,7 @@
use crate::{
input::{mouse, ButtonState},
layout, Clipboard, Element, Event, Hasher, Layout, Length, Point,
Rectangle, Size, Widget,
Rectangle, Widget,
};
use std::hash::Hash;
@ -168,13 +168,11 @@ where
.pad(padding);
let mut content = self.content.layout(renderer, &limits);
content.bounds.x = padding;
content.bounds.y = padding;
content.move_to(Point::new(padding, padding));
let size = limits.resolve(content.size()).pad(padding);
layout::Node::with_children(size, Size::ZERO, vec![content])
layout::Node::with_children(size, vec![content])
}
fn on_event(