Optimize adjusting scene rect after moving label.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-10-27 10:36:55 +03:00
parent d61f732bde
commit 3df6c09934
7 changed files with 25 additions and 3 deletions

View File

@ -99,6 +99,11 @@ void VAbstractOperation::ChangeLabelPosition(quint32 id, const QPointF &pos)
point->setMx(pos.x());
point->setMy(pos.y());
item->RefreshPointGeometry(*(point.data()));
if (QGraphicsScene *sc = scene())
{
VMainGraphicsView::NewSceneRect(sc, qApp->getSceneView(), item);
}
}
}
}

View File

@ -228,6 +228,11 @@ void VToolDoublePoint::ChangeLabelPosition(quint32 id, const QPointF &pos)
point->setMx(pos.x());
point->setMy(pos.y());
firstPoint->RefreshPointGeometry(*(point.data()));
if (QGraphicsScene *sc = scene())
{
VMainGraphicsView::NewSceneRect(sc, qApp->getSceneView(), firstPoint);
}
}
else if (id == p2id)
{
@ -235,6 +240,11 @@ void VToolDoublePoint::ChangeLabelPosition(quint32 id, const QPointF &pos)
point->setMx(pos.x());
point->setMy(pos.y());
secondPoint->RefreshPointGeometry(*(point.data()));
if (QGraphicsScene *sc = scene())
{
VMainGraphicsView::NewSceneRect(sc, qApp->getSceneView(), secondPoint);
}
}
}

View File

@ -335,6 +335,11 @@ void VToolSinglePoint::ChangeLabelPosition(quint32 id, const QPointF &pos)
m_namePoint->setPos(pos);
m_namePoint->blockSignals(false);
RefreshLine();
if (QGraphicsScene *sc = scene())
{
VMainGraphicsView::NewSceneRect(sc, qApp->getSceneView(), this);
}
}
}

View File

@ -51,6 +51,7 @@
#include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/vcontainer.h"
#include "../vwidgets/vmaingraphicsscene.h"
#include "../vwidgets/vmaingraphicsview.h"
#include "../vabstracttool.h"
#include "../vdatatool.h"
#include "vabstractnode.h"
@ -139,6 +140,10 @@ void VNodePoint::ChangeLabelPosition(quint32 id, const QPointF &pos)
m_namePoint->setPos(pos);
m_namePoint->blockSignals(false);
RefreshLine();
if (QGraphicsScene *sc = scene())
{
VMainGraphicsView::NewSceneRect(sc, qApp->getSceneView(), this);
}
}
}

View File

@ -148,7 +148,6 @@ void MoveDoubleLabel::Do(const QPointF &pos)
{
tool->ChangeLabelPosition(nodeId, pos);
}
VMainGraphicsView::NewSceneRect(m_scene, qApp->getSceneView());
}
else
{

View File

@ -102,7 +102,6 @@ void MoveLabel::Do(const QPointF &pos)
{
tool->ChangeLabelPosition(nodeId, pos);
}
VMainGraphicsView::NewSceneRect(m_scene, qApp->getSceneView());
}
else
{

View File

@ -106,7 +106,6 @@ void OperationMoveLabel::Do(const QPointF &pos)
{
tool->ChangeLabelPosition(nodeId, pos);
}
VMainGraphicsView::NewSceneRect(m_scene, qApp->getSceneView());
}
else
{