logic: Fixed base and derived classes not correctly at top or bottom
Prioritize inheritance and override over all other edges.
This commit is contained in:
@@ -537,13 +537,25 @@ void GraphController::bundleNodes()
|
||||
bundleInfo->isDefined = true;
|
||||
}
|
||||
|
||||
if (bundleInfo->layoutVertical)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
n->forEachEdgeOfType(
|
||||
~Edge::EDGE_MEMBER,
|
||||
[&bundleInfo, &n](Edge* e)
|
||||
{
|
||||
if (bundleInfo->layoutVertical)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (e->isType(Edge::EDGE_INHERITANCE | Edge::EDGE_OVERRIDE))
|
||||
{
|
||||
bundleInfo->layoutVertical = true;
|
||||
bundleInfo->isReferenced = false;
|
||||
bundleInfo->isReferencing = false;
|
||||
}
|
||||
|
||||
if (e->isType(Edge::EDGE_AGGREGATION))
|
||||
|
||||
@@ -172,11 +172,6 @@ void BucketGrid::createBuckets(
|
||||
DummyNode* owner = findTopMostDummyNodeRecursive(nodes, edge->ownerId);
|
||||
DummyNode* target = findTopMostDummyNodeRecursive(nodes, edge->targetId);
|
||||
|
||||
if (edge->getDirection() == TokenComponentAggregation::DIRECTION_BACKWARD)
|
||||
{
|
||||
std::swap(owner, target);
|
||||
}
|
||||
|
||||
bool removeEdge = false;
|
||||
if (!owner || !target)
|
||||
{
|
||||
@@ -185,6 +180,20 @@ void BucketGrid::createBuckets(
|
||||
else
|
||||
{
|
||||
bool horizontal = !owner->bundleInfo.layoutVertical && !target->bundleInfo.layoutVertical;
|
||||
|
||||
if (!horizontal)
|
||||
{
|
||||
if ((owner->bundleInfo.layoutVertical && owner->bundleInfo.isReferenced) ||
|
||||
(target->bundleInfo.layoutVertical && target->bundleInfo.isReferencing))
|
||||
{
|
||||
std::swap(owner, target);
|
||||
}
|
||||
}
|
||||
else if (edge->getDirection() == TokenComponentAggregation::DIRECTION_BACKWARD)
|
||||
{
|
||||
std::swap(owner, target);
|
||||
}
|
||||
|
||||
removeEdge = addNode(owner, target, horizontal);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Cache<KeyType, ValType, Hasher>::Cache(std::function<ValType(KeyType)> calculato
|
||||
{
|
||||
}
|
||||
|
||||
template <typename KeyType, typename ValType, typename Hasher = hash<KeyType>>
|
||||
template <typename KeyType, typename ValType, typename Hasher>
|
||||
ValType Cache<KeyType, ValType, Hasher>::getValue(KeyType key)
|
||||
{
|
||||
typename std::unordered_map<KeyType, ValType>::const_iterator it = m_map.find(key);
|
||||
|
||||
Reference in New Issue
Block a user