Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
Fix some cut'n'paste errors, and update README slightly.
  • Loading branch information
raphlinus committed Nov 5, 2023
1 parent 0240754 commit 3ae4864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/xilem_svg/README.md
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 1 addition & 3 deletions crates/xilem_svg/src/common_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ use crate::{

pub struct Fill<T, V> {
child: V,
// This could reasonably be static Cow also, but keep things simple
brush: Brush,
phantom: PhantomData<T>,
}

pub struct Stroke<T, V> {
child: V,
// This could reasonably be static Cow also, but keep things simple
brush: Brush,
style: peniko::kurbo::Stroke,
phantom: PhantomData<T>,
Expand Down Expand Up @@ -140,7 +138,7 @@ impl<T, V: View<T>> View<T> for Stroke<T, V> {
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);
}
Expand Down

0 comments on commit 3ae4864

Please sign in to comment.