From 13a93ef5df067b0a77c99920b1638c34d8ec7d9b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 16 May 2017 13:47:36 +0300 Subject: [PATCH] Fix internal path support of pen style. --HG-- branch : develop --- src/libs/ifc/schema/pattern/v0.5.0.xsd | 2 +- src/libs/vpatterndb/vpiecepath.cpp | 6 +----- src/libs/vtools/dialogs/tools/dialogpiecepath.cpp | 2 +- src/libs/vtools/visualization/path/vistoolpiecepath.cpp | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libs/ifc/schema/pattern/v0.5.0.xsd b/src/libs/ifc/schema/pattern/v0.5.0.xsd index 0ac923dfa..59865fb36 100644 --- a/src/libs/ifc/schema/pattern/v0.5.0.xsd +++ b/src/libs/ifc/schema/pattern/v0.5.0.xsd @@ -370,7 +370,7 @@ - + diff --git a/src/libs/vpatterndb/vpiecepath.cpp b/src/libs/vpatterndb/vpiecepath.cpp index 46fff2fab..a24a94eff 100644 --- a/src/libs/vpatterndb/vpiecepath.cpp +++ b/src/libs/vpatterndb/vpiecepath.cpp @@ -354,11 +354,7 @@ QPainterPath VPiecePath::PainterPath(const VContainer *data) const if (not points.isEmpty()) { - path.moveTo(points.at(0)); - for (qint32 i = 1; i < points.count(); ++i) - { - path.lineTo(points.at(i)); - } + path.addPolygon(QPolygonF(points)); path.setFillRule(Qt::WindingFill); } diff --git a/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp index b1931b5a6..5911971fd 100644 --- a/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp @@ -703,7 +703,7 @@ void DialogPiecePath::InitPathTab() ui->lineEditName->setClearButtonEnabled(true); #endif - FillComboBoxTypeLine(ui->comboBoxPenType, LineStylesPics()); + FillComboBoxTypeLine(ui->comboBoxPenType, CurvePenStylesPics()); connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogPiecePath::NameChanged); diff --git a/src/libs/vtools/visualization/path/vistoolpiecepath.cpp b/src/libs/vtools/visualization/path/vistoolpiecepath.cpp index 403614584..feade2a23 100644 --- a/src/libs/vtools/visualization/path/vistoolpiecepath.cpp +++ b/src/libs/vtools/visualization/path/vistoolpiecepath.cpp @@ -49,7 +49,7 @@ void VisToolPiecePath::RefreshGeometry() if (m_path.CountNodes() > 0) { - DrawPath(this, m_path.PainterPath(Visualization::data), mainColor, Qt::SolidLine, Qt::RoundCap); + DrawPath(this, m_path.PainterPath(Visualization::data), mainColor, m_path.GetPenType(), Qt::RoundCap); const QVector nodes = m_path.PathNodePoints(Visualization::data);