Optimize adjusting scene rect after moving label.
--HG-- branch : develop
This commit is contained in:
parent
d61f732bde
commit
3df6c09934
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,6 @@ void MoveDoubleLabel::Do(const QPointF &pos)
|
|||
{
|
||||
tool->ChangeLabelPosition(nodeId, pos);
|
||||
}
|
||||
VMainGraphicsView::NewSceneRect(m_scene, qApp->getSceneView());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -102,7 +102,6 @@ void MoveLabel::Do(const QPointF &pos)
|
|||
{
|
||||
tool->ChangeLabelPosition(nodeId, pos);
|
||||
}
|
||||
VMainGraphicsView::NewSceneRect(m_scene, qApp->getSceneView());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -106,7 +106,6 @@ void OperationMoveLabel::Do(const QPointF &pos)
|
|||
{
|
||||
tool->ChangeLabelPosition(nodeId, pos);
|
||||
}
|
||||
VMainGraphicsView::NewSceneRect(m_scene, qApp->getSceneView());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user