ui: stop old graph animation before starting new one
This commit is contained in:
@@ -113,6 +113,8 @@ void QtGraphView::finishedTransition()
|
|||||||
view->setInteractive(true);
|
view->setInteractive(true);
|
||||||
|
|
||||||
switchToNewGraphData();
|
switchToNewGraphData();
|
||||||
|
|
||||||
|
m_transition.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtGraphView::switchToNewGraphData()
|
void QtGraphView::switchToNewGraphData()
|
||||||
@@ -170,6 +172,12 @@ void QtGraphView::doRebuildGraph(
|
|||||||
const std::vector<DummyNode>& nodes,
|
const std::vector<DummyNode>& nodes,
|
||||||
const std::vector<DummyEdge>& edges
|
const std::vector<DummyEdge>& edges
|
||||||
){
|
){
|
||||||
|
if (m_transition)
|
||||||
|
{
|
||||||
|
m_transition->stop();
|
||||||
|
switchToNewGraphData();
|
||||||
|
}
|
||||||
|
|
||||||
QGraphicsView* view = getView();
|
QGraphicsView* view = getView();
|
||||||
|
|
||||||
m_nodes.clear();
|
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)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user