From 5ca119bb5b0b051f77b87a2747ccbb4049d8fff6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 22 Mar 2017 17:04:32 +0200 Subject: [PATCH] Spline Path lost data about duplicate. --HG-- branch : develop --- src/app/valentina/xml/vpattern.cpp | 10 ++-------- .../tools/drawTools/toolcurve/vtoolsplinepath.cpp | 10 ++++++++-- .../vtools/tools/drawTools/toolcurve/vtoolsplinepath.h | 5 +++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 79ec633d8..db96f0fbd 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -2312,12 +2312,6 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement const QString color = GetParametrString(domElement, AttrColor, ColorBlack); const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); - auto path = new VSplinePath(); - if (duplicate > 0) - { - path->SetDuplicate(duplicate); - } - QVector points; QVector angle1, a1; QVector angle2, a2; @@ -2351,8 +2345,8 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement l1 = length1; l2 = length2; - VToolSplinePath *spl = VToolSplinePath::Create(id, points, a1, a2, l1, l2, color, scene, this, data, parse, - Source::FromFile); + VToolSplinePath *spl = VToolSplinePath::Create(id, points, a1, a2, l1, l2, color, duplicate, scene, this, data, + parse, Source::FromFile); if (spl != nullptr) { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 41440eda1..45863c18a 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -229,11 +229,17 @@ VToolSplinePath* VToolSplinePath::Create(const quint32 _id, VSplinePath *path, c //--------------------------------------------------------------------------------------------------------------------- VToolSplinePath *VToolSplinePath::Create(const quint32 _id, const QVector &points, QVector &a1, QVector &a2, QVector &l1, QVector &l2, - const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation) + const QString &color, quint32 duplicate, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation) { auto path = new VSplinePath(); + if (duplicate > 0) + { + path->SetDuplicate(duplicate); + } + for (int i = 0; i < points.size(); ++i) { const qreal calcAngle1 = CheckFormula(_id, a1[i], data); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h index 9c405a3ca..995423a52 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h @@ -62,8 +62,9 @@ public: const Document &parse, const Source &typeCreation); static VToolSplinePath *Create(const quint32 _id, const QVector &points, QVector &a1, QVector &a2, QVector &l1, QVector &l2, - const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, - VContainer *data, const Document &parse, const Source &typeCreation); + const QString &color, quint32 duplicate, VMainGraphicsScene *scene, + VAbstractPattern *doc, VContainer *data, const Document &parse, + const Source &typeCreation); static const QString ToolType; static const QString OldToolType; static void UpdatePathPoints(VAbstractPattern *doc, QDomElement &element, const VSplinePath &path);