the aliasing svg renderer
groups who needs them
bendn 2023-10-18
parent d81aba6 · commit 7693a30
-rw-r--r--src/render.rs7
-rw-r--r--src/tree.rs17
2 files changed, 1 insertions, 23 deletions
diff --git a/src/render.rs b/src/render.rs
index db6c1c3..bca39b5 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -50,13 +50,6 @@ fn render(node: &Node, img: &mut Image<Box<[u8]>, 4>) {
..
// TODO: stroek
}) => img.points(&point(path), color.col(*opacity)),
- Node::Group {
- ..
- } => {
- // for child in &**children {
- // render(child, img);
- // }
- }
t => unimplemented!("{t:?}"),
}
}
diff --git a/src/tree.rs b/src/tree.rs
index 2020342..23284a2 100644
--- a/src/tree.rs
+++ b/src/tree.rs
@@ -30,10 +30,6 @@ pub enum PathNode {
#[derive(Debug)]
pub enum Node {
- Group {
- opacity: Opacity,
- children: Box<[Node]>,
- },
Path(PathNode),
Image(Image),
}
@@ -86,18 +82,6 @@ impl PColor for Paint {
}
fn convert(node: usvg::Node, to: &mut Vec<Node>) {
match &*node.clone().borrow() {
- usvg::NodeKind::Group(g) => {
- let mut children = vec![];
- collect(node, &mut children);
- let mut children = children.into_boxed_slice();
- for child in &mut *children {
- child.transform(g.transform);
- }
- to.push(Node::Group {
- opacity: g.opacity,
- children,
- });
- }
usvg::NodeKind::Path(usvg::Path {
stroke:
Some(usvg::Stroke {
@@ -168,6 +152,7 @@ fn convert(node: usvg::Node, to: &mut Vec<Node>) {
path: pointify(path, *transform),
}));
}
+ usvg::NodeKind::Group(_) => {}
usvg::NodeKind::Image(_) => todo!(),
usvg::NodeKind::Text(_) => unimplemented!(),
}