Skip to content

Commit

Permalink
Merge pull request #69 from anonymous2585/fix/68
Browse files Browse the repository at this point in the history
Fix overlapping contracts in debugger window (#68)
  • Loading branch information
gustavopsantos authored Oct 12, 2024
2 parents 6ce54bc + ea80c73 commit a596cfb
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 a596cfb

Please sign in to comment.