From 3bcbb29cf3d0397864a63f5b243de52f9c97c480 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 6 Feb 2021 15:36:27 +0100 Subject: svg-flatten: Fix invalid export of negative gerber coordinates --- svg-flatten/src/out_gerber.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/svg-flatten/src/out_gerber.cpp b/svg-flatten/src/out_gerber.cpp index b32e6e4..f16a06b 100644 --- a/svg-flatten/src/out_gerber.cpp +++ b/svg-flatten/src/out_gerber.cpp @@ -78,15 +78,15 @@ SimpleGerberOutput& SimpleGerberOutput::operator<<(const Polygon &poly) { double x = round((poly[0][0] * m_scale + m_offset[0]) * m_gerber_scale); double y = round((m_height - poly[0][1] * m_scale + m_offset[1]) * m_gerber_scale); m_out << "G36*" << endl; - m_out << "X" << setw(m_digits_int + m_digits_frac) << setfill('0') << (long long int)x - << "Y" << setw(m_digits_int + m_digits_frac) << setfill('0') << (long long int)y + m_out << "X" << setw(m_digits_int + m_digits_frac) << setfill('0') << std::internal /* isn't C++ a marvel of engineering? */ << (long long int)x + << "Y" << setw(m_digits_int + m_digits_frac) << setfill('0') << std::internal << (long long int)y << "D02*" << endl; m_out << "G01*" << endl; for (size_t i=1; i