ui: fixed 2 nodes layouted on top of each other

This commit is contained in:
Eberhard Graether
2015-05-18 14:02:19 +02:00
parent e4d71f8a01
commit f0e101e994
@@ -235,6 +235,13 @@ void QtGraphPostprocessor::resolveOverlap(std::list<std::shared_ptr<QtGraphNode>
{
grad = (*it)->getPosition();
grad.normalize();
// catch special case of node being at position 0/0
if(grad.getLengthSquared() <= 0.000001f)
{
grad.y = 1.0f;
}
grad *= -1.0f;
}