From d514a90a4de0b419045dbdfbdf54e3a8a5b67179 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. --HG-- branch : release --- ChangeLog.txt | 1 + .../drawTools/operation/vabstractoperation.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 472264fd8..157d2c53f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -27,6 +27,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)); } }