summaryrefslogtreecommitdiffstats
path: root/examples/svg
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-31 01:19:28 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-31 01:21:51 +0200
commit749a9588d738de9c3ae734e6f026768c77eb3cce (patch)
tree719597f4577c9329e738389847ff9224c2ac075d /examples/svg
parent6e9ab1cd6f5358d323040379e3aadbed2cc4f7f8 (diff)
downloadiced-749a9588d738de9c3ae734e6f026768c77eb3cce.tar.gz
iced-749a9588d738de9c3ae734e6f026768c77eb3cce.tar.bz2
iced-749a9588d738de9c3ae734e6f026768c77eb3cce.zip
Implement `padding` support for `Container`
Diffstat (limited to 'examples/svg')
-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 811fdfb5..9b785fc4 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() {
env_logger::init();
@@ -23,18 +23,17 @@ impl Sandbox for Tiger {
fn update(&mut self, _message: ()) {}
fn view(&mut self) -> Element<()> {
- let content = Column::new().padding(20).push(
- Svg::new(format!(
- "{}/resources/tiger.svg",
- env!("CARGO_MANIFEST_DIR")
- ))
- .width(Length::Fill)
- .height(Length::Fill),
- );
-
- Container::new(content)
+ let svg = Svg::new(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()