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_path.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svg-flatten/src/svg_path.h') diff --git a/svg-flatten/src/svg_path.h b/svg-flatten/src/svg_path.h index 2ab29ec..611f517 100644 --- a/svg-flatten/src/svg_path.h +++ b/svg-flatten/src/svg_path.h @@ -19,11 +19,11 @@ #pragma once #include -#include #include "svg_geom.h" +#include "geom2d.hpp" namespace gerbolyze { -void load_svg_path(cairo_t *cr, const pugi::xml_node &node, ClipperLib::PolyTree &ptree_stroke, ClipperLib::PolyTree &ptree_fill, double curve_tolerance); +void load_svg_path(xform2d &mat, const pugi::xml_node &node, ClipperLib::PolyTree &ptree_stroke, ClipperLib::PolyTree &ptree_fill, double curve_tolerance); void parse_dasharray(const pugi::xml_node &node, std::vector &out); void dash_path(const ClipperLib::Path &in, ClipperLib::Paths &out, const std::vector dasharray, double dash_offset=0.0); } -- cgit