From 4c1c0d4d0a933eda5e055757042224ab2c682e52 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 22 Mar 2016 17:25:16 +0200 Subject: [PATCH] Fixed empty point label in SplinePath name. --HG-- branch : develop --- src/libs/vgeometry/vabstractcubicbezierpath.cpp | 2 +- .../toolsinglepoint/toolcut/vtoolcutsplinepath.cpp | 6 +++--- .../toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h | 2 +- src/libs/vtools/visualization/vistoolcutsplinepath.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/vgeometry/vabstractcubicbezierpath.cpp b/src/libs/vgeometry/vabstractcubicbezierpath.cpp index d5d7d736d..2de85f056 100644 --- a/src/libs/vgeometry/vabstractcubicbezierpath.cpp +++ b/src/libs/vgeometry/vabstractcubicbezierpath.cpp @@ -214,7 +214,7 @@ void VAbstractCubicBezierPath::CreateName() { name = splPath; name.append(QString("_%1").arg(FirstPoint().name())); - if (CountSubSpl() >= 2) + if (CountSubSpl() >= 1) { name.append(QString("_%1").arg(LastPoint().name())); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index eac1dd822..6b333664e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -131,13 +131,12 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString quint32 id = _id; VSplinePath *splPath1 = nullptr; VSplinePath *splPath2 = nullptr; - VPointF *p = VToolCutSplinePath::CutSplinePath(qApp->toPixel(result), splPath, &splPath1, &splPath2); + VPointF *p = VToolCutSplinePath::CutSplinePath(qApp->toPixel(result), splPath, pointName, &splPath1, &splPath2); SCASSERT(splPath1 != nullptr); SCASSERT(splPath2 != nullptr); SCASSERT(p != nullptr); - p->setName(pointName); p->setMx(mx); p->setMy(my); @@ -203,7 +202,7 @@ void VToolCutSplinePath::ShowVisualization(bool show) //--------------------------------------------------------------------------------------------------------------------- VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointer &splPath, - VSplinePath **splPath1, VSplinePath **splPath2) + const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2) { SCASSERT(splPath != nullptr); @@ -212,6 +211,7 @@ VPointF *VToolCutSplinePath::CutSplinePath(qreal length, const QSharedPointerCutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3); VPointF *p = new VPointF(point); + p->setName(pName); const QVector points = splPath->GetSplinePath(); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h index 65ab52353..a025849ca 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h @@ -61,7 +61,7 @@ public: virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; static VPointF *CutSplinePath(qreal length, const QSharedPointer &splPath, - VSplinePath **splPath1, VSplinePath **splPath2); + const QString &pName, VSplinePath **splPath1, VSplinePath **splPath2); protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) Q_DECL_OVERRIDE; virtual void SaveDialog(QDomElement &domElement) Q_DECL_OVERRIDE; diff --git a/src/libs/vtools/visualization/vistoolcutsplinepath.cpp b/src/libs/vtools/visualization/vistoolcutsplinepath.cpp index dc29ce613..f0e39f76a 100644 --- a/src/libs/vtools/visualization/vistoolcutsplinepath.cpp +++ b/src/libs/vtools/visualization/vistoolcutsplinepath.cpp @@ -61,7 +61,7 @@ void VisToolCutSplinePath::RefreshGeometry() { VSplinePath *spPath1 = nullptr; VSplinePath *spPath2 = nullptr; - VPointF *p = VToolCutSplinePath::CutSplinePath(length, splPath, &spPath1, &spPath2); + VPointF *p = VToolCutSplinePath::CutSplinePath(length, splPath, "X", &spPath1, &spPath2); SCASSERT(p != nullptr); SCASSERT(spPath1 != nullptr); SCASSERT(spPath2 != nullptr);