mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Per-font ellipsis configuration
This commit is contained in:
parent
5b80116c8d
commit
4a3e21c1ab
1 changed files with 3 additions and 2 deletions
|
@ -130,6 +130,7 @@ namespace Beefy.gfx
|
|||
List<AltFont> mAlternates;
|
||||
MarkRefData mMarkRefData ~ delete _;
|
||||
float[] mLoKerningTable;
|
||||
public StringView mEllipsis = "...";
|
||||
|
||||
public this()
|
||||
{
|
||||
|
@ -868,14 +869,14 @@ namespace Beefy.gfx
|
|||
|
||||
if (stringEndMode == FontOverflowMode.Ellipsis)
|
||||
{
|
||||
float ellipsisLen = GetWidth("...");
|
||||
float ellipsisLen = GetWidth(mEllipsis);
|
||||
if (width < ellipsisLen)
|
||||
return 0; // Don't draw at all if we don't even have enough space for the ellipsis
|
||||
|
||||
int strLen = GetCharCountToLength(workingStr, width - ellipsisLen);
|
||||
tempStr = scope:: String(Math.Min(strLen, 128));
|
||||
tempStr.Append(theString, 0, strLen);
|
||||
tempStr.Append("...");
|
||||
tempStr.Append(mEllipsis);
|
||||
workingStr = tempStr;
|
||||
aWidth = GetWidth(workingStr);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue