diff --git a/BeefLibs/Beefy2D/src/gfx/Font.bf b/BeefLibs/Beefy2D/src/gfx/Font.bf index c626dd89..f40459a4 100644 --- a/BeefLibs/Beefy2D/src/gfx/Font.bf +++ b/BeefLibs/Beefy2D/src/gfx/Font.bf @@ -887,7 +887,7 @@ namespace Beefy.gfx if (fontMetrics != null) fontMetrics.mLineCount++; - drawHeight += Draw(g, StringView(workingStr, 0, checkIdx), useX, useY, justification, width, stringEndMode, fontMetrics); + drawHeight += Draw(g, StringView(workingStr, 0, checkIdx), useX, useY, justification, width, .Truncate, fontMetrics); useY += GetLineSpacing(); workingStr.Adjust(checkIdx); } diff --git a/IDE/src/ui/HoverWatch.bf b/IDE/src/ui/HoverWatch.bf index 50247f85..050c07b4 100644 --- a/IDE/src/ui/HoverWatch.bf +++ b/IDE/src/ui/HoverWatch.bf @@ -1257,6 +1257,8 @@ namespace IDE.ui if ((wantWordWrap) && (useWidth < wantWidth)) { + float actualMaxWidth = 0; + for (WatchListViewItem listViewItem in listView.GetRoot().mChildItems) { if (listViewItem.mLabel == null) @@ -1265,11 +1267,14 @@ namespace IDE.ui listView.mWordWrap = true; FontMetrics fontMetrics = .(); float nameHeight = font.Draw(null, listViewItem.mLabel, 0, 0, -1, useWidth - GS!(32), FontOverflowMode.Wrap, &fontMetrics); + actualMaxWidth = Math.Max(actualMaxWidth, fontMetrics.mMaxWidth); float addHeight = nameHeight - listViewItem.mSelfHeight; height += addHeight; } + useWidth = actualMaxWidth + GS!(32); + listView.mColumns[0].mWidth = useWidth - GS!(2); }