Fixed resizing scene when move detail.
When first time create detail MoveDetail class gets wrong scene pointer and this cause refreshing wrong scene. --HG-- branch : develop
This commit is contained in:
parent
bd7f328a8a
commit
eec1240da0
|
@ -378,7 +378,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const
|
|||
// value - this is new position.
|
||||
const QPointF newPos = value.toPointF();
|
||||
|
||||
MoveDetail *moveDet = new MoveDetail(doc, newPos.x(), newPos.y(), id);
|
||||
MoveDetail *moveDet = new MoveDetail(doc, newPos.x(), newPos.y(), id, scene());
|
||||
connect(moveDet, &MoveDetail::NeedLiteParsing, doc, &VAbstractPattern::LiteParseTree);
|
||||
qApp->getUndoStack()->push(moveDet);
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MoveDetail::MoveDetail(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id,
|
||||
QUndoCommand *parent)
|
||||
: VUndoCommand(QDomElement(), doc, parent), oldX(0.0), oldY(0.0), newX(x), newY(y), scene(qApp->getCurrentScene())
|
||||
QGraphicsScene *scene, QUndoCommand *parent)
|
||||
: VUndoCommand(QDomElement(), doc, parent), oldX(0.0), oldY(0.0), newX(x), newY(y), scene(scene)
|
||||
{
|
||||
setText(QObject::tr("move detail"));
|
||||
nodeId = id;
|
||||
|
|
|
@ -37,7 +37,7 @@ class MoveDetail : public VUndoCommand
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MoveDetail(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id,
|
||||
MoveDetail(VAbstractPattern *doc, const double &x, const double &y, const quint32 &id, QGraphicsScene *scene,
|
||||
QUndoCommand *parent = 0);
|
||||
virtual ~MoveDetail() Q_DECL_OVERRIDE;
|
||||
virtual void undo() Q_DECL_OVERRIDE;
|
||||
|
|
Loading…
Reference in New Issue
Block a user