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
This commit is contained in:
Roman Telezhynskyi 2019-06-18 19:04:26 +03:00
parent 4a95c43d0d
commit d514a90a4d
2 changed files with 14 additions and 0 deletions

View File

@ -27,6 +27,7 @@
- [#971] Group operation do not work with VCubicBezierPath. - [#971] Group operation do not work with VCubicBezierPath.
- Regression in method DialogTool::GetNodeName. - Regression in method DialogTool::GetNodeName.
- Fix visualization for tool Point from arc and tangent. - 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 # Version 0.6.1 October 23, 2018
- [#885] Regression. Broken support for multi size measurements. - [#885] Regression. Broken support for multi size measurements.

View File

@ -495,6 +495,12 @@ void VAbstractOperation::ChangeLabelVisibility(quint32 id, bool visible)
VAbstractSimple *obj = operatedObjects.value(id); VAbstractSimple *obj = operatedObjects.value(id);
if (obj && obj->GetType() == GOType::Point) 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)); 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); VAbstractSimple *obj = operatedObjects.value(id);
if (obj && obj->GetType() == GOType::Point) 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)); qApp->getUndoStack()->push(new OperationMoveLabel(m_id, doc, pos, id));
} }
} }