Skip to content

Commit d702d5c

Browse files
committed
Make GraphNode width dynamic to fit plugin name
1 parent 8bc78e8 commit d702d5c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Source/UI/GraphViewer.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,15 @@ void GraphViewer::addNode (GenericEditor* editor)
4242
GraphNode* gn = new GraphNode (editor, this);
4343
addAndMakeVisible (gn);
4444
availableNodes.add (gn);
45+
46+
int nodeWidth = 150;
47+
48+
if (gn->getName().length() > 15)
49+
{
50+
nodeWidth += (gn->getName().length() - 15) * 10;
51+
}
4552

46-
gn->setBounds (20, 20, 150, 50);
53+
gn->setBounds (20, 20, nodeWidth, 50);
4754
updateNodeLocations();
4855
}
4956

0 commit comments

Comments
 (0)