Skip to content

Commit

Permalink
Fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierLemoine committed Feb 26, 2025
1 parent 9f001bd commit ade12b4
Showing 1 changed file with 14 additions and 31 deletions.
45 changes: 14 additions & 31 deletions dessin-dioxus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ pub fn SVG(shape: ReadOnlySignal<Shape>, options: Option<SVGOptions>) -> Element
let used_font = use_signal(|| HashSet::new());

rsx! {
svg {
view_box,
svg { view_box,
Shaper {
shape,
parent_transform: nalgebra::convert(Scale2::new(1., -1.)),
Expand Down Expand Up @@ -143,11 +142,7 @@ fn Shaper(
rsx! {
g {
for shape in shapes {
Shaper {
shape: shape,
parent_transform,
used_font,
}
Shaper { shape, parent_transform, used_font }
}
}
}
Expand Down Expand Up @@ -207,11 +202,7 @@ fn Shaper(
stroke_width,
stroke_dasharray,

Shaper {
parent_transform,
shape: *shape,
used_font,
}
Shaper { parent_transform, shape: *shape, used_font }
}
}
}
Expand All @@ -225,7 +216,7 @@ fn Shaper(
ellipse {
rx: ellipse.semi_major_axis,
ry: ellipse.semi_minor_axis,
transform: "translate({x} {y}) rotate({r})"
transform: "translate({x} {y}) rotate({r})",
}
}
}
Expand All @@ -249,7 +240,7 @@ fn Shaper(
x: image.center.x - image.width / 2.,
y: image.center.y - image.width / 2.,
transform: "rotate({r})",
href: "data:image/png;base64,{data}"
href: "data:image/png;base64,{data}",
}
}
}
Expand Down Expand Up @@ -282,31 +273,23 @@ fn Shaper(

rsx! {
text {
font_family:"{font}",
text_anchor:"{align}",
font_size:"{text.font_size}px",
font_weight:"{weight}",
"text-style":"{text_style}",
transform:"translate({x} {y}) rotate({r})",
font_family: "{font}",
text_anchor: "{align}",
font_size: "{text.font_size}px",
font_weight: "{weight}",
"text-style": "{text_style}",
transform: "translate({x} {y}) rotate({r})",
if let Some(curve) = text.on_curve {
path {
id: id.clone(),
d: write_curve(curve)
}
textPath {
href: id,
{text.text}
}
path { id: id.clone(), d: write_curve(curve) }
textPath { href: id, {text.text} }
} else {
{text.text}
}
}
}
}
Shape::Curve(curve) => rsx! {
path {
d: write_curve(curve.position(&parent_transform))
}
path { d: write_curve(curve.position(&parent_transform)) }
},
Shape::Dynamic {
local_transform,
Expand Down

0 comments on commit ade12b4

Please sign in to comment.