From ceb2868b0239e5a85c58e869fdd0c334d80f807c Mon Sep 17 00:00:00 2001 From: David Varley Date: Sat, 15 Aug 2020 22:00:14 +1000 Subject: [PATCH] Fix dxf export for copied conductors --- sources/exportdialog.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp index 759d66531..b5db3ccfa 100644 --- a/sources/exportdialog.cpp +++ b/sources/exportdialog.cpp @@ -578,12 +578,14 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee } //Draw conductors - foreach(Conductor *cond, list_conductors) { - foreach(ConductorSegment *segment, cond -> segmentsList()) { - qreal x1 = (segment -> firstPoint().x()) * Createdxf::xScale; - qreal y1 = Createdxf::sheetHeight - (segment -> firstPoint().y() * Createdxf::yScale); - qreal x2 = (segment -> secondPoint().x()) * Createdxf::xScale; - qreal y2 = Createdxf::sheetHeight - (segment -> secondPoint().y() * Createdxf::yScale); + foreach(Conductor *cond, list_conductors) { + qreal cx = cond->pos().x(); + qreal cy = cond->pos().y(); + foreach(ConductorSegment *segment, cond -> segmentsList()) { + qreal x1 = (cx + segment -> firstPoint().x()) * Createdxf::xScale; + qreal y1 = Createdxf::sheetHeight - ((cy + segment -> firstPoint().y()) * Createdxf::yScale); + qreal x2 = (cx + segment -> secondPoint().x()) * Createdxf::xScale; + qreal y2 = Createdxf::sheetHeight - ((cy + segment -> secondPoint().y()) * Createdxf::yScale); Createdxf::drawLine(file_path, x1, y1, x2, y2, 0); } //Draw conductor text item