Skip to content

Commit

Permalink
Fix overlapping contracts in debugger window (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous2585 committed Oct 11, 2024
1 parent 935f1ce commit ea80c73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Assets/Reflex/Editor/DebuggingWindow/MultiColumnTreeView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,21 @@ private void DrawContracts(TreeViewItem<MyTreeElement> item, Rect rect, string[]
// Clipping group
GUI.BeginGroup(rect);
{
float labelXOffset = 0.0f;
foreach (var contract in contracts)
{
var content = new GUIContent($"{contract}");
var labelWidth = style.CalcSize(content).x;

// Draw the label within the bounds of the rect
Rect labelRect = new Rect(0, 0, labelWidth, rect.height);
Rect labelRect = new Rect(labelXOffset, 0, labelWidth, rect.height);
GUI.Label(labelRect, content, style);

// Move the rect for the next contract
rect.xMin += labelWidth + 4;
labelXOffset += labelWidth + 4;

// Stop drawing if the labels go beyond the column's width
if (rect.xMin > rect.width)
if (labelXOffset > rect.width)
break;
}
}
Expand Down

0 comments on commit ea80c73

Please sign in to comment.