summaryrefslogtreecommitdiffstats
path: root/examples/svg/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/svg/src/main.rs')
-rw-r--r--examples/svg/src/main.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs
index 80e28cf8..e19eeca2 100644
--- a/examples/svg/src/main.rs
+++ b/examples/svg/src/main.rs
@@ -1,4 +1,4 @@
-use iced::{Column, Container, Element, Length, Sandbox, Settings, Svg};
+use iced::{Container, Element, Length, Sandbox, Settings, Svg};
pub fn main() {
Tiger::run(Settings::default())
@@ -20,18 +20,17 @@ impl Sandbox for Tiger {
fn update(&mut self, _message: ()) {}
fn view(&mut self) -> Element<()> {
- let content = Column::new().padding(20).push(
- Svg::from_path(format!(
- "{}/resources/tiger.svg",
- env!("CARGO_MANIFEST_DIR")
- ))
- .width(Length::Fill)
- .height(Length::Fill),
- );
-
- Container::new(content)
+ let svg = Svg::from_path(format!(
+ "{}/resources/tiger.svg",
+ env!("CARGO_MANIFEST_DIR")
+ ))
+ .width(Length::Fill)
+ .height(Length::Fill);
+
+ Container::new(svg)
.width(Length::Fill)
.height(Length::Fill)
+ .padding(20)
.center_x()
.center_y()
.into()