From ae009158cc322b69403a2512ac51582062029c99 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 31 Mar 2020 00:39:18 +0200 Subject: Implement `svg::Handle::from_memory` Useful if you already have your SVG data in memory. --- examples/svg/Cargo.toml | 1 - examples/svg/src/main.rs | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/svg/Cargo.toml b/examples/svg/Cargo.toml index 161ee6a8..d8f83ac2 100644 --- a/examples/svg/Cargo.toml +++ b/examples/svg/Cargo.toml @@ -7,4 +7,3 @@ publish = false [dependencies] iced = { path = "../..", features = ["svg"] } -env_logger = "0.7" diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs index 811fdfb5..80e28cf8 100644 --- a/examples/svg/src/main.rs +++ b/examples/svg/src/main.rs @@ -1,19 +1,16 @@ use iced::{Column, Container, Element, Length, Sandbox, Settings, Svg}; pub fn main() { - env_logger::init(); - Tiger::run(Settings::default()) } -#[derive(Default)] struct Tiger; impl Sandbox for Tiger { type Message = (); fn new() -> Self { - Self::default() + Tiger } fn title(&self) -> String { @@ -24,7 +21,7 @@ impl Sandbox for Tiger { fn view(&mut self) -> Element<()> { let content = Column::new().padding(20).push( - Svg::new(format!( + Svg::from_path(format!( "{}/resources/tiger.svg", env!("CARGO_MANIFEST_DIR") )) -- cgit