From 2bf477ca8a69c5cd9e5d56c6e79cded7fc9da000 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 25 Jan 2018 10:31:59 +0200 Subject: [PATCH] Fix bug in copy piece tool. --HG-- branch : develop --- src/libs/vtools/tools/vtoolseamallowance.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 28641b30f..6b511dac8 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -2007,6 +2007,9 @@ QVector VToolSeamAllowance::DuplicatePins(const QVector &pins, { QSharedPointer pin = initData.data->GeometricObject(pins.at(i)); + VAbstractNode *tool = qobject_cast(VAbstractPattern::getTool(i)); + SCASSERT(tool != nullptr) + VToolPinInitData initNodeData; initNodeData.id = initData.data->AddGObject(new VPointF(*pin)); initNodeData.pointId = pin->getIdObject(); @@ -2016,6 +2019,7 @@ QVector VToolSeamAllowance::DuplicatePins(const QVector &pins, initNodeData.parse = Document::FullParse; initNodeData.typeCreation = Source::FromTool; initNodeData.drawName = initData.drawName; + initNodeData.idTool = tool->GetIdTool(); VToolPin::Create(initNodeData); newPins.append(initNodeData.id); @@ -2031,6 +2035,8 @@ QVector VToolSeamAllowance::DuplicatePlaceLabels(const QVector for(int i=0; i < placeLabels.size(); ++i) { QSharedPointer label = initData.data->GeometricObject(placeLabels.at(i)); + VAbstractNode *tool = qobject_cast(VAbstractPattern::getTool(placeLabels.at(i))); + SCASSERT(tool != nullptr) VToolPlaceLabelInitData initNodeData; initNodeData.idObject = NULL_ID; // piece id @@ -2045,6 +2051,7 @@ QVector VToolSeamAllowance::DuplicatePlaceLabels(const QVector initNodeData.type = label->GetLabelType(); initNodeData.centerPoint = label->GetCenterPoint(); initNodeData.id = initNodeData.data->AddGObject(new VPlaceLabelItem(*label)); + initNodeData.idTool = tool->GetIdTool(); VToolPlaceLabel::Create(initNodeData); newPlaceLabels.append(initNodeData.id);