ui: Fixed moving bundle nodes was not stored in undo stack

This commit is contained in:
Eberhard Graether
2017-02-21 00:10:49 +01:00
parent 04a5abdf98
commit d02e3e74d0
3 changed files with 17 additions and 1 deletions
@@ -1438,6 +1438,14 @@ DummyNode* GraphController::getDummyGraphNodeById(Id tokenId) const
return it->second.get();
}
for (std::shared_ptr<DummyNode> node : m_dummyNodes)
{
if (node->tokenId == tokenId)
{
return node.get();
}
}
return nullptr;
}
@@ -4,6 +4,7 @@
#include <QPen>
#include "utility/messaging/type/MessageGraphNodeBundleSplit.h"
#include "utility/messaging/type/MessageGraphNodeMove.h"
#include "component/view/GraphViewStyle.h"
#include "qt/graphics/QtCountCircleItem.h"
@@ -46,6 +47,13 @@ void QtGraphNodeBundle::onClick()
).dispatch();
}
void QtGraphNodeBundle::moved(const Vec2i& oldPosition)
{
QtGraphNode::moved(oldPosition);
MessageGraphNodeMove(m_tokenId, getPosition() - oldPosition).dispatch();
}
void QtGraphNodeBundle::updateStyle()
{
GraphViewStyle::NodeStyle style;
@@ -18,7 +18,7 @@ public:
virtual Id getTokenId() const;
virtual void onClick();
virtual void moved(const Vec2i& oldPosition);
virtual void updateStyle();
protected: