aboutsummaryrefslogtreecommitdiff
path: root/src/svg_doc.cpp
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-01-28 23:15:36 +0100
committerjaseg <git@jaseg.de>2021-01-28 23:15:36 +0100
commit6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d (patch)
tree76dcc0361419ccbbffa5900c2d18ee2956124a5f /src/svg_doc.cpp
parentf65cd52304a9a57118d82e527469839d5663e7ba (diff)
downloadgerbolyze-6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d.tar.gz
gerbolyze-6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d.tar.bz2
gerbolyze-6d1a7750c5fa0d78c7fe35a7b7bff8934b86089d.zip
Per-image vectorizer selection works
Diffstat (limited to 'src/svg_doc.cpp')
-rw-r--r--src/svg_doc.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/svg_doc.cpp b/src/svg_doc.cpp
index 5b36f35..39c5724 100644
--- a/src/svg_doc.cpp
+++ b/src/svg_doc.cpp
@@ -173,11 +173,16 @@ void gerbolyze::SVGDocument::export_svg_group(const RenderSettings &rset, const
export_svg_path(rset, node, clip_path);
} else if (name == "image") {
- if (!rset.m_vec)
+ ImageVectorizer *vec = rset.m_vec_sel.select(node);
+ if (!vec) {
+ cerr << "Cannot resolve vectorizer for node \"" << node.attribute("id").value() << "\"" << endl;
continue;
+ }
double min_feature_size_px = mm_to_doc_units(rset.m_minimum_feature_size_mm);
- rset.m_vec->vectorize_image(cr, node, clip_path, viewport_matrix, *polygon_sink, min_feature_size_px);
+ vec->vectorize_image(cr, node, clip_path, viewport_matrix, *polygon_sink, min_feature_size_px);
+ delete vec;
+
} else if (name == "defs") {
/* ignore */
} else {