Fixed issue #825. Curve path editing - undo.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-03-23 15:39:53 +02:00
parent 3d8cdb6630
commit 45a4a280b0
2 changed files with 8 additions and 8 deletions

View file

@ -266,7 +266,7 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp
if (qApp->Settings()->IsFreeCurveMode() && not moved) if (qApp->Settings()->IsFreeCurveMode() && not moved)
{ {
oldMoveSpline = spline; oldMoveSpline = QSharedPointer<VSpline>::create(*spline);
moved = true; moved = true;
} }
@ -278,7 +278,7 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp
} }
else else
{ {
newMoveSpline = QSharedPointer<VSpline>(new VSpline(spl)); newMoveSpline = QSharedPointer<VSpline>::create(spl);
VAbstractTool::data.UpdateGObject(m_id, newMoveSpline); VAbstractTool::data.UpdateGObject(m_id, newMoveSpline);
RefreshGeometry(); RefreshGeometry();
@ -404,7 +404,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (qApp->Settings()->IsFreeCurveMode() && not moved) if (qApp->Settings()->IsFreeCurveMode() && not moved)
{ {
oldMoveSpline = spline; oldMoveSpline = QSharedPointer<VSpline>::create(*spline);
moved = true; moved = true;
} }
@ -443,7 +443,7 @@ void VToolSpline::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
oldPosition = event->scenePos(); // Now mouse here oldPosition = event->scenePos(); // Now mouse here
newMoveSpline = QSharedPointer<VSpline>(new VSpline(spline->GetP1(), p2, p3, spline->GetP4())); newMoveSpline = QSharedPointer<VSpline>::create(spline->GetP1(), p2, p3, spline->GetP4());
if (not qApp->Settings()->IsFreeCurveMode()) if (not qApp->Settings()->IsFreeCurveMode())
{ {

View file

@ -262,11 +262,11 @@ void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, cons
if (qApp->Settings()->IsFreeCurveMode() && not moved) if (qApp->Settings()->IsFreeCurveMode() && not moved)
{ {
oldMoveSplinePath = oldSplPath; oldMoveSplinePath = QSharedPointer<VSplinePath>::create(*oldSplPath);
moved = true; moved = true;
} }
QSharedPointer<VSplinePath> newSplPath = oldSplPath; QSharedPointer<VSplinePath> newSplPath = QSharedPointer<VSplinePath>::create(*oldSplPath);
const VSpline spl = CorrectedSpline(newSplPath->GetSpline(indexSpline), position, pos); const VSpline spl = CorrectedSpline(newSplPath->GetSpline(indexSpline), position, pos);
UpdateControlPoints(spl, newSplPath, indexSpline); UpdateControlPoints(spl, newSplPath, indexSpline);
@ -559,11 +559,11 @@ void VToolSplinePath::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
if (qApp->Settings()->IsFreeCurveMode() && not moved) if (qApp->Settings()->IsFreeCurveMode() && not moved)
{ {
oldMoveSplinePath = oldSplPath; oldMoveSplinePath = QSharedPointer<VSplinePath>::create(*oldSplPath);
moved = true; moved = true;
} }
newMoveSplinePath = oldSplPath; newMoveSplinePath = QSharedPointer<VSplinePath>::create(*oldSplPath);
VSpline spline = newMoveSplinePath->GetSpline(splIndex); VSpline spline = newMoveSplinePath->GetSpline(splIndex);
const qreal t = spline.ParamT(oldPosition); const qreal t = spline.ParamT(oldPosition);