From 2660465b317cbfd827e4059b67d2aab230ae6fff Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 31 May 2016 14:02:30 +0200 Subject: [PATCH] ui: Fixed derived bundle layouted to wrong bucket --- .../component/controller/GraphController.cpp | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index dce2b9a2..d271c353 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -607,6 +607,17 @@ void GraphController::bundleNodes() } } + // Left for debugging + // for (std::shared_ptr node : m_dummyNodes) + // { + // std::cout << node->bundleInfo.isActive << " "; + // std::cout << node->bundleInfo.isDefined << " "; + // std::cout << node->bundleInfo.layoutVertical << " "; + // std::cout << node->bundleInfo.isReferenced << " "; + // std::cout << node->bundleInfo.isReferencing << " "; + // std::cout << node->name << std::endl; + // } + // bundle bundleNodesAndEdgesMatching( [](const DummyNode::BundleInfo& info) @@ -701,8 +712,11 @@ void GraphController::bundleNodesAndEdgesMatching( m_dummyNodes.erase(m_dummyNodes.begin() + matchedNodeIndices[i]); } - bundleNode->tokenId = bundleNode->bundledNodes[0]->data->getId(); - bundleNode->bundleInfo.layoutVertical = bundleNode->bundledNodes[0]->bundleInfo.layoutVertical; + DummyNode* firstNode = bundleNode->bundledNodes[0].get(); + bundleNode->tokenId = firstNode->data->getId(); + bundleNode->bundleInfo.layoutVertical = firstNode->bundleInfo.layoutVertical; + bundleNode->bundleInfo.isReferenced = firstNode->bundleInfo.isReferenced; + bundleNode->bundleInfo.isReferencing = firstNode->bundleInfo.isReferencing; m_dummyNodes.push_back(bundleNode); if (m_dummyEdges.size() == 0) @@ -740,7 +754,7 @@ void GraphController::bundleNodesAndEdgesMatching( std::shared_ptr bundleEdge = std::make_shared(); bundleEdge->visible = true; bundleEdge->ownerId = (owner ? edge->targetId : edge->ownerId); - bundleEdge->targetId = bundleNode->bundledNodes.front()->data->getId(); + bundleEdge->targetId = bundleNode->tokenId; bundleEdges.push_back(bundleEdge); bundleEdgePtr = bundleEdges.back().get(); }