aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/src/out_scaler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'svg-flatten/src/out_scaler.cpp')
-rw-r--r--svg-flatten/src/out_scaler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/svg-flatten/src/out_scaler.cpp b/svg-flatten/src/out_scaler.cpp
index 9b7de4e..0320d69 100644
--- a/svg-flatten/src/out_scaler.cpp
+++ b/svg-flatten/src/out_scaler.cpp
@@ -29,6 +29,7 @@
using namespace gerbolyze;
using namespace std;
+/* FIXME thoroughly test ApertureToken scale handling */
void PolygonScaler::header(d2p origin, d2p size) {
m_sink.header({origin[0] * m_scale, origin[1] * m_scale}, {size[0] * m_scale, size[1] * m_scale});
}
@@ -45,7 +46,11 @@ PolygonScaler &PolygonScaler::operator<<(const LayerNameToken &layer_name) {
PolygonScaler &PolygonScaler::operator<<(GerberPolarityToken pol) {
m_sink << pol;
+ return *this;
+}
+PolygonScaler &PolygonScaler::operator<<(const ApertureToken &tok) {
+ m_sink << ApertureToken(tok.m_size * m_scale);
return *this;
}
@@ -59,3 +64,8 @@ PolygonScaler &PolygonScaler::operator<<(const Polygon &poly) {
return *this;
}
+PolygonScaler &PolygonScaler::operator<<(const DrillToken &tok) {
+ d2p new_center { tok.m_center[0] * m_scale, tok.m_center[1] * m_scale };
+ m_sink << DrillToken(new_center);
+ return *this;
+}