File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,9 +158,40 @@ void GraphViewer::updateNodeLocations()
158158 }
159159 }
160160
161+ // remove extra horizontal shift
162+ // for (auto& node : availableNodes)
163+ // {
164+ // if (node->getHorzShift() > 0)
165+ // {
166+ // for (int i = 0; i < 3; i++)
167+ // {
168+ // if (isEmptySpace(node->getLevel(), node->getHorzShift()-1))
169+ // {
170+ // node->setHorzShift(node->getHorzShift()-1);
171+ // }
172+ // }
173+ // }
174+ // }
175+
161176 repaint ();
162177}
163178
179+ bool GraphViewer::isEmptySpace (int level, int horzShift)
180+ {
181+ if (horzShift < 0 )
182+ return false ;
183+
184+ for (auto & node : availableNodes)
185+ {
186+ if (node->getHorzShift () == horzShift && node->getLevel () == level)
187+ {
188+ return false ;
189+ }
190+ }
191+
192+ return true ;
193+ }
194+
164195
165196int GraphViewer::getIndexOfEditor (GenericEditor* editor) const
166197{
Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ class GraphViewer : public Component
154154private:
155155 void connectNodes (int , int , Graphics&);
156156 void adjustBranchLayout (GraphNode*, int );
157+ bool isEmptySpace (int level, int horzShift);
157158
158159 int getLevel (GraphNode*);
159160 int getIndexOfEditor (GenericEditor* editor) const ;
You can’t perform that action at this time.
0 commit comments