aboutsummaryrefslogtreecommitdiff
path: root/svg-flatten/src/out_scaler.cpp
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2022-06-18 17:29:27 +0200
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2022-06-18 17:29:27 +0200
commit14e9d7fbc2a935ec9c2e6eb9d68e8d250f9614d4 (patch)
tree9f86768b8ffc04a39db9b614aa4cc11956dda29b /svg-flatten/src/out_scaler.cpp
parent1622e9c9435d263c3c275718947b1030ad9b6b48 (diff)
downloadgerbolyze-14e9d7fbc2a935ec9c2e6eb9d68e8d250f9614d4.tar.gz
gerbolyze-14e9d7fbc2a935ec9c2e6eb9d68e8d250f9614d4.tar.bz2
gerbolyze-14e9d7fbc2a935ec9c2e6eb9d68e8d250f9614d4.zip
svg-flatten: add drill handling to outline 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;
+}