From 643dce08b7903717dd73e8458a9496c13b06192b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 18 Jun 2019 19:04:26 +0300 Subject: [PATCH] Changing settings for move and rotate tools through property browser does not take in count previous change for label point and Show label option. (grafted from 8c626cf05d645f1e9b40dd44a9f361ff1fd2dad7) --HG-- branch : develop --- ChangeLog.txt | 1 + .../drawTools/operation/vabstractoperation.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index f50a60316..85e8e97c3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -51,6 +51,7 @@ - [#971] Group operation do not work with VCubicBezierPath. - Regression in method DialogTool::GetNodeName. - Fix visualization for tool Point from arc and tangent. +- Changing settings for move and rotate tools through property browser does not take in count previous change for label point and Show label option. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp index 9dfe475b6..5e9cdc2e0 100644 --- a/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vabstractoperation.cpp @@ -495,6 +495,12 @@ void VAbstractOperation::ChangeLabelVisibility(quint32 id, bool visible) VAbstractSimple *obj = operatedObjects.value(id); if (obj && obj->GetType() == GOType::Point) { + auto dItem = std::find_if(destination.begin(), destination.end(), + [id](const DestinationItem &dItem) { return dItem.id == id; }); + if (dItem != destination.cend()) + { + dItem->showLabel = visible; + } qApp->getUndoStack()->push(new OperationShowLabel(doc, m_id, id, visible)); } } @@ -508,6 +514,13 @@ void VAbstractOperation::UpdateNamePosition(quint32 id, const QPointF &pos) VAbstractSimple *obj = operatedObjects.value(id); if (obj && obj->GetType() == GOType::Point) { + auto dItem = std::find_if(destination.begin(), destination.end(), + [id](const DestinationItem &dItem) { return dItem.id == id; }); + if (dItem != destination.end()) + { + dItem->mx = pos.x(); + dItem->my = pos.y(); + } qApp->getUndoStack()->push(new OperationMoveLabel(m_id, doc, pos, id)); } }