aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/include/gerbolyze.hpp
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-08-18 21:28:58 +0200
committerjaseg <git@jaseg.de>2021-08-18 21:28:58 +0200
commitfae8532b05b8c3cd79cd09a6b1986bc8ff9ad306 (patch)
tree8bb42fdb3da0ba13c74031b7ad6c277611bf34eb /svg-flatten/include/gerbolyze.hpp
parentaaade1b168b3780a9c2ed1387165086ede33bc54 (diff)
downloadgerbolyze-fae8532b05b8c3cd79cd09a6b1986bc8ff9ad306.tar.gz
gerbolyze-fae8532b05b8c3cd79cd09a6b1986bc8ff9ad306.tar.bz2
gerbolyze-fae8532b05b8c3cd79cd09a6b1986bc8ff9ad306.zip
svg-flatten: Fix include/exclude logic
Diffstat (limited to 'svg-flatten/include/gerbolyze.hpp')
-rw-r--r--svg-flatten/include/gerbolyze.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/svg-flatten/include/gerbolyze.hpp b/svg-flatten/include/gerbolyze.hpp
index 2c21173..9311a98 100644
--- a/svg-flatten/include/gerbolyze.hpp
+++ b/svg-flatten/include/gerbolyze.hpp
@@ -143,15 +143,15 @@ namespace gerbolyze {
class ElementSelector {
public:
- virtual bool match(const pugi::xml_node &node, bool included, bool is_root) const {
- (void) node, (void) included, (void) is_root;
+ virtual bool match(const pugi::xml_node &node, bool is_toplevel, bool parent_include) const {
+ (void) node, (void) is_toplevel, (void) parent_include;
return true;
}
};
class IDElementSelector : public ElementSelector {
public:
- virtual bool match(const pugi::xml_node &node, bool included, bool is_root) const;
+ virtual bool match(const pugi::xml_node &node, bool is_toplevel, bool parent_include) const;
std::vector<std::string> include;
std::vector<std::string> exclude;
@@ -196,7 +196,8 @@ namespace gerbolyze {
xform2d transform);
RenderContext(RenderContext &parent,
xform2d transform,
- ClipperLib::Paths &clip);
+ ClipperLib::Paths &clip,
+ bool included);
PolygonSink &sink() { return m_sink; }
const ElementSelector &sel() { return m_sel; }
@@ -209,7 +210,7 @@ namespace gerbolyze {
m_mat.transform(transform);
}
bool match(const pugi::xml_node &node) {
- return m_sel.match(node, m_included, m_root);
+ return m_sel.match(node, m_root, m_included);
}
private: