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_geom.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'svg-flatten/src/svg_geom.h') diff --git a/svg-flatten/src/svg_geom.h b/svg-flatten/src/svg_geom.h index 5f00479..1e9f5cd 100644 --- a/svg-flatten/src/svg_geom.h +++ b/svg-flatten/src/svg_geom.h @@ -18,19 +18,17 @@ #pragma once -#include #include #include namespace gerbolyze { -ClipperLib::IntRect get_paths_bounds(const ClipperLib::Paths &paths); -enum ClipperLib::PolyFillType clipper_fill_rule(const pugi::xml_node &node); -enum ClipperLib::EndType clipper_end_type(const pugi::xml_node &node); -enum ClipperLib::JoinType clipper_join_type(const pugi::xml_node &node); -void dehole_polytree(ClipperLib::PolyTree &ptree, ClipperLib::Paths &out); -void combine_clip_paths(ClipperLib::Paths &in_a, ClipperLib::Paths &in_b, ClipperLib::Paths &out); -void transform_paths(cairo_t *cr, ClipperLib::Paths &paths, cairo_matrix_t *mat=nullptr); + ClipperLib::IntRect get_paths_bounds(const ClipperLib::Paths &paths); + enum ClipperLib::PolyFillType clipper_fill_rule(const pugi::xml_node &node); + enum ClipperLib::EndType clipper_end_type(const pugi::xml_node &node); + enum ClipperLib::JoinType clipper_join_type(const pugi::xml_node &node); + void dehole_polytree(ClipperLib::PolyTree &ptree, ClipperLib::Paths &out); + void combine_clip_paths(ClipperLib::Paths &in_a, ClipperLib::Paths &in_b, ClipperLib::Paths &out); } /* namespace gerbolyze */ -- cgit