ui: stop old graph animation before starting new one

This commit is contained in:
Eberhard Graether
2015-06-09 23:23:07 +02:00
parent e85b9e7425
commit 063d972b13
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -113,6 +113,8 @@ void QtGraphView::finishedTransition()
view->setInteractive(true);
switchToNewGraphData();
m_transition.reset();
}
void QtGraphView::switchToNewGraphData()
@@ -170,6 +172,12 @@ void QtGraphView::doRebuildGraph(
const std::vector<DummyNode>& nodes,
const std::vector<DummyEdge>& edges
){
if (m_transition)
{
m_transition->stop();
switchToNewGraphData();
}
QGraphicsView* view = getView();
m_nodes.clear();
@@ -66,9 +66,9 @@ void GraphLayouter::layoutSimpleRing(std::vector<DummyNode>& nodes)
void GraphLayouter::layoutSpectralPrototype(std::vector<DummyNode>& nodes, const std::vector<DummyEdge>& edges)
{
if(nodes.size() < 2)
if (nodes.size() < 2)
{
LOG_WARNING("Not enough nodes for layouting");
LOG_INFO("Not enough nodes for layouting");
return;
}