From 3ae4864856ec7e47093f9b9d181d3a29aa238585 Mon Sep 17 00:00:00 2001 From: Raph Levien Date: Sun, 5 Nov 2023 08:58:32 -0800 Subject: [PATCH] Address review feedback Fix some cut'n'paste errors, and update README slightly. --- crates/xilem_svg/README.md | 4 ++-- crates/xilem_svg/src/common_attrs.rs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/xilem_svg/README.md b/crates/xilem_svg/README.md index 2fb1fbf66..a9cf3661a 100644 --- a/crates/xilem_svg/README.md +++ b/crates/xilem_svg/README.md @@ -1,7 +1,7 @@ # Xilemsvg prototype -This is a proof of concept showing how to use `xilem_core` to render interactive vector graphics into SVG DOM nodes, running in a browser. A next step would be to factor it into a library so that applications can depend on it, but at the moment the test scene is baked in. +This is a proof of concept showing how to use `xilem_core` to render interactive vector graphics into SVG DOM nodes, running in a browser. It is provided as a library and some examples. -The easiest way to run it is to use [Trunk]. Run `trunk serve`, then navigate the browser to the link provided (usually `http://localhost:8080`). +The easiest way to run the examples is to use [Trunk]. Go into the appropriate subdirectory of `web_examples`, run `trunk serve`, then navigate the browser to the link provided (usually `http://localhost:8080`). [Trunk]: https://trunkrs.dev/ diff --git a/crates/xilem_svg/src/common_attrs.rs b/crates/xilem_svg/src/common_attrs.rs index 6be5b521a..a11d82e51 100644 --- a/crates/xilem_svg/src/common_attrs.rs +++ b/crates/xilem_svg/src/common_attrs.rs @@ -13,14 +13,12 @@ use crate::{ pub struct Fill { child: V, - // This could reasonably be static Cow also, but keep things simple brush: Brush, phantom: PhantomData, } pub struct Stroke { child: V, - // This could reasonably be static Cow also, but keep things simple brush: Brush, style: peniko::kurbo::Stroke, phantom: PhantomData, @@ -140,7 +138,7 @@ impl> View for Stroke { if self.brush != prev.brush || prev_id != *id { element .as_element_ref() - .set_attribute("fill", &brush_to_string(&self.brush)) + .set_attribute("stroke", &brush_to_string(&self.brush)) .unwrap(); changed.insert(ChangeFlags::OTHER_CHANGE); }