From c88821853d4b2af1a4849f756a03a322d7bf23f0 Mon Sep 17 00:00:00 2001 From: Marcel Wiessler Date: Mon, 21 Aug 2023 13:01:04 +0200 Subject: [PATCH] Reduce graph view auto layout spacing --- source/MaterialXGraphEditor/Graph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/MaterialXGraphEditor/Graph.cpp b/source/MaterialXGraphEditor/Graph.cpp index 9bf3afcd1b..8f0ee2e528 100644 --- a/source/MaterialXGraphEditor/Graph.cpp +++ b/source/MaterialXGraphEditor/Graph.cpp @@ -570,7 +570,7 @@ ImVec2 Graph::layoutPosition(UiNodePtr layoutNode, ImVec2 startingPos, bool init UiNodePtr nextNode = layoutNode->getConnectedNode(pins[i]->_name); if (nextNode) { - startingPos.x = (1200.f - ((layoutNode->_level) * 350)) * _fontScale; + startingPos.x = (1200.f - ((layoutNode->_level) * 250)) * _fontScale; ed::SetNodePosition(layoutNode->getId(), startingPos); layoutNode->setPos(ImVec2(startingPos)); // call layout position on upstream node with newPos as -140 to the left of current node @@ -581,7 +581,7 @@ ImVec2 Graph::layoutPosition(UiNodePtr layoutNode, ImVec2 startingPos, bool init } else { - startingPos.x = (1200.f - ((layoutNode->_level) * 350)) * _fontScale; + startingPos.x = (1200.f - ((layoutNode->_level) * 250)) * _fontScale; layoutNode->setPos(ImVec2(startingPos)); // set current node position ed::SetNodePosition(layoutNode->getId(), ImVec2(startingPos));