Remove unnecessary Container in bezier_tool

This commit is contained in:
Héctor Ramón Jiménez 2020-04-28 04:41:25 +02:00
parent e65585ae17
commit 7f1e7aea07

View file

@ -1,7 +1,6 @@
//! This example showcases an interactive `Canvas` for drawing Bézier curves. //! This example showcases an interactive `Canvas` for drawing Bézier curves.
use iced::{ use iced::{
button, Align, Button, Column, Container, Element, Length, Sandbox, button, Align, Button, Column, Element, Length, Sandbox, Settings, Text,
Settings, Text,
}; };
pub fn main() { pub fn main() {
@ -49,7 +48,7 @@ impl Sandbox for Example {
} }
fn view(&mut self) -> Element<Message> { fn view(&mut self) -> Element<Message> {
let content = Column::new() Column::new()
.padding(20) .padding(20)
.spacing(20) .spacing(20)
.align_items(Align::Center) .align_items(Align::Center)
@ -63,13 +62,7 @@ impl Sandbox for Example {
Button::new(&mut self.button_state, Text::new("Clear")) Button::new(&mut self.button_state, Text::new("Clear"))
.padding(8) .padding(8)
.on_press(Message::Clear), .on_press(Message::Clear),
); )
Container::new(content)
.width(Length::Fill)
.height(Length::Fill)
.center_x()
.center_y()
.into() .into()
} }
} }