From f0e101e994e013d95544371bb066bcfad43fe498 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Mon, 18 May 2015 14:02:19 +0200 Subject: [PATCH] ui: fixed 2 nodes layouted on top of each other --- src/app/qt/utility/QtGraphPostprocessor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/qt/utility/QtGraphPostprocessor.cpp b/src/app/qt/utility/QtGraphPostprocessor.cpp index a23ee019..6aa7b996 100644 --- a/src/app/qt/utility/QtGraphPostprocessor.cpp +++ b/src/app/qt/utility/QtGraphPostprocessor.cpp @@ -235,6 +235,13 @@ void QtGraphPostprocessor::resolveOverlap(std::list { 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; }