aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/include
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2021-08-17 22:55:47 +0200
committerjaseg <git@jaseg.de>2021-08-17 22:55:47 +0200
commit236c4a44855b93c0dd4dc8e5e2ab80380b595046 (patch)
treecb2f7986208729866199e2916da9f9c67ba1dca2 /svg-flatten/include
parent4ffb4c65825ab0a5ded00ff799b494097e7bd143 (diff)
downloadgerbolyze-236c4a44855b93c0dd4dc8e5e2ab80380b595046.tar.gz
gerbolyze-236c4a44855b93c0dd4dc8e5e2ab80380b595046.tar.bz2
gerbolyze-236c4a44855b93c0dd4dc8e5e2ab80380b595046.zip
svg-flatten: Fix case where document unit is not mm
Diffstat (limited to 'svg-flatten/include')
-rw-r--r--svg-flatten/include/gerbolyze.hpp14
1 files changed, 14 insertions, 0 deletions
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) {}