From 063d972b13dd48dbd7bc6265e4fec5e2223025ef Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 9 Jun 2015 23:23:07 +0200 Subject: [PATCH] ui: stop old graph animation before starting new one --- src/app/qt/view/QtGraphView.cpp | 8 ++++++++ src/lib/component/controller/GraphLayouter.cpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/qt/view/QtGraphView.cpp b/src/app/qt/view/QtGraphView.cpp index 186d34b2..89ec8a8b 100644 --- a/src/app/qt/view/QtGraphView.cpp +++ b/src/app/qt/view/QtGraphView.cpp @@ -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& nodes, const std::vector& edges ){ + if (m_transition) + { + m_transition->stop(); + switchToNewGraphData(); + } + QGraphicsView* view = getView(); m_nodes.clear(); diff --git a/src/lib/component/controller/GraphLayouter.cpp b/src/lib/component/controller/GraphLayouter.cpp index 3700030a..a15926b7 100644 --- a/src/lib/component/controller/GraphLayouter.cpp +++ b/src/lib/component/controller/GraphLayouter.cpp @@ -66,9 +66,9 @@ void GraphLayouter::layoutSimpleRing(std::vector& nodes) void GraphLayouter::layoutSpectralPrototype(std::vector& nodes, const std::vector& edges) { - if(nodes.size() < 2) + if (nodes.size() < 2) { - LOG_WARNING("Not enough nodes for layouting"); + LOG_INFO("Not enough nodes for layouting"); return; }