Skip to content

Commit

Permalink
Fix kurbo::BezPath d attribute for xilem_web::svg::path element (#715)
Browse files Browse the repository at this point in the history
Regressed in #699

cc @Philipp-M 🦆
  • Loading branch information
RagibHasin authored Oct 25, 2024
1 parent 53a5354 commit 16df671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xilem_web/src/svg/kurbo_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl<State: 'static, Action: 'static> OrphanView<BezPath, State, Action, DynMess
) -> (Self::OrphanElement, Self::OrphanViewState) {
create_element("path", ctx, 1, |element, ctx| {
let mut element = Self::OrphanElement::from_with_ctx(element, ctx);
element.props.attributes().push(("path", view.to_svg()));
element.props.attributes().push(("d", view.to_svg()));
(element, ())
})
}
Expand All @@ -211,9 +211,9 @@ impl<State: 'static, Action: 'static> OrphanView<BezPath, State, Action, DynMess
Attributes::rebuild(element, 1, |mut element| {
let attrs: &mut Attributes = element.modifier();
if attrs.was_created() {
attrs.push(("path", new.to_svg()));
attrs.push(("d", new.to_svg()));
} else if new != prev {
attrs.mutate(|m| *m = ("path", new.to_svg()).into());
attrs.mutate(|m| *m = ("d", new.to_svg()).into());
} else {
attrs.skip(1);
}
Expand Down

0 comments on commit 16df671

Please sign in to comment.