From 236c4a44855b93c0dd4dc8e5e2ab80380b595046 Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 17 Aug 2021 22:55:47 +0200 Subject: svg-flatten: Fix case where document unit is not mm --- svg-flatten/include/gerbolyze.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'svg-flatten/include') diff --git a/svg-flatten/include/gerbolyze.hpp b/svg-flatten/include/gerbolyze.hpp index 9b05bdb..7b70501 100644 --- a/svg-flatten/include/gerbolyze.hpp +++ b/svg-flatten/include/gerbolyze.hpp @@ -110,6 +110,20 @@ namespace gerbolyze { GerberPolarityToken m_current_polarity = GRB_POL_DARK; }; + class Scaler : public PolygonSink { + public: + Scaler(PolygonSink &sink, double scale=1.0) : m_sink(sink), m_scale(scale) {} + virtual void header(d2p origin, d2p size); + virtual Scaler &operator<<(const Polygon &poly); + virtual Scaler &operator<<(const LayerNameToken &layer_name); + virtual Scaler &operator<<(GerberPolarityToken pol); + virtual void footer(); + + private: + PolygonSink &m_sink; + double m_scale; + }; + class StreamPolygonSink : public PolygonSink { public: StreamPolygonSink(std::ostream &out, bool only_polys=false) : m_only_polys(only_polys), m_out(out) {} -- cgit