Fixed empty point label in SplinePath name.
--HG-- branch : develop
This commit is contained in:
parent
2e0bf11261
commit
4c1c0d4d0a
|
@ -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()));
|
||||
|
||||
|
|
|
@ -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<VAbstractCubicBezierPath> &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 QSharedPointer<VA
|
|||
|
||||
const QPointF point = splPath->CutSplinePath(length, p1, p2, spl1p2, spl1p3, spl2p2, spl2p3);
|
||||
VPointF *p = new VPointF(point);
|
||||
p->setName(pName);
|
||||
|
||||
const QVector<VSplinePoint> points = splPath->GetSplinePath();
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
|
||||
|
||||
static VPointF *CutSplinePath(qreal length, const QSharedPointer<VAbstractCubicBezierPath> &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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user