From 1180ebdc1f18044a74f22f17b4d500ce7d6543fa Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 25 Apr 2021 00:09:57 +0200 Subject: Remove cairo dependency We initially used Cairo for its bezier flattening algorithm. That algorithm turned out to be a bit too imprecise at the scales we're working at here (#17), so I ended up porting over some code from Antigrain Graphics. The only other thing we used Cairo for was debug output and coordinate transforms, so I just wrote the relevant vector math in a small header file, deleted all debug output code and thus eliminated the cairo dependency. This is a step towards Windows builds. --- svg-flatten/src/svg_pattern.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'svg-flatten/src/svg_pattern.h') diff --git a/svg-flatten/src/svg_pattern.h b/svg-flatten/src/svg_pattern.h index e6a6fe2..56444dd 100644 --- a/svg-flatten/src/svg_pattern.h +++ b/svg-flatten/src/svg_pattern.h @@ -19,10 +19,12 @@ #pragma once #include -#include + #include #include + #include "svg_import_util.h" +#include "geom2d.hpp" namespace gerbolyze { @@ -34,13 +36,14 @@ public: Pattern() {} Pattern(const pugi::xml_node &node, SVGDocument &doc); - void tile (const gerbolyze::RenderSettings &rset, ClipperLib::Paths &clip); + void tile (xform2d &mat, const gerbolyze::RenderSettings &rset, ClipperLib::Paths &clip); private: double x, y, w, h; double vb_x, vb_y, vb_w, vb_h; bool has_vb; - std::string patternTransform; + xform2d patternTransform; + xform2d patternTransform_inv; enum RelativeUnits patternUnits; enum RelativeUnits patternContentUnits; const pugi::xml_node _node; -- cgit