summaryrefslogtreecommitdiffstats
path: root/examples/svg
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-31 00:39:18 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-03-31 00:39:18 +0200
commitae009158cc322b69403a2512ac51582062029c99 (patch)
treebd9d64674e046f743c8688e9246e1605fa3573ed /examples/svg
parent6e9ab1cd6f5358d323040379e3aadbed2cc4f7f8 (diff)
downloadiced-ae009158cc322b69403a2512ac51582062029c99.tar.gz
iced-ae009158cc322b69403a2512ac51582062029c99.tar.bz2
iced-ae009158cc322b69403a2512ac51582062029c99.zip
Implement `svg::Handle::from_memory`
Useful if you already have your SVG data in memory.
Diffstat (limited to 'examples/svg')
-rw-r--r--examples/svg/Cargo.toml1
-rw-r--r--examples/svg/src/main.rs7
2 files changed, 2 insertions, 6 deletions
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")
))