src/ui/elements/GraphUi.h
/**
     * Recursively resets all the positions of nodes to (0, 0)
     */
Recursively resets all the positions of nodes to (0, 0)
Recursively resets all the positions of nodes to ( 0 0 )
void resetBranchPos(Node* node) {
      if (node == nullptr || node->mInfo->name == "FeedbackNode") { return; }
      getUiFromNode(node)->setTranslation(0, 0);
      NodeSocket* socket = nullptr;
      for (int i = 0; i < node->mOutputCount; i++) {
        socket = &node->mSocketsOut[i];
        for (int j = 0; j < GUITARD_MAX_SOCKET_CONNECTIONS; j++) {
          if (socket->mConnectedTo[j] != nullptr) {
            if (socket->mConnectedTo[j]->mIndex == 0) {
              resetBranchPos(socket->mConnectedTo[j]->mParentNode);
            }
          }
        }
      }
    }
void resetBranchPos ( Node * node ) { if ( node == nullptr || node -> mInfo -> name == " " ) { return ; } getUiFromNode ( node ) -> setTranslation ( 0 , 0 ) ; NodeSocket * socket = nullptr ; for ( int i = 0 ; i < node -> mOutputCount ; i ++ ) { socket = & node -> mSocketsOut [ i ] ; for ( int j = 0 ; j < GUITARD_MAX_SOCKET_CONNECTIONS ; j ++ ) { if ( socket -> mConnectedTo [ j ] != nullptr ) { if ( socket -> mConnectedTo [ j ] -> mIndex == 0 ) { resetBranchPos ( socket -> mConnectedTo [ j ] -> mParentNode ) ; } } } } }
Recursively resets all the positions of nodes to (0, 0)
Recursively resets all the positions of nodes to ( 0 0 )