mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
Add some initial widget functionality (prefs partly working)
This commit is contained in:
@@ -275,17 +275,17 @@ void GetFirstWordOfString (StringPtr stringIn, StringPtr stringOut)
|
||||
// font. If the text would exceed our width limit, characters<72>
|
||||
// are dropped off the end of the string and "<22>" appended.
|
||||
|
||||
void CollapseStringToWidth (StringPtr theStr, short wide)
|
||||
void CollapseStringToWidth (DrawSurface *surface, StringPtr theStr, short wide)
|
||||
{
|
||||
short dotsWide;
|
||||
Boolean tooWide;
|
||||
|
||||
dotsWide = StringWidth(PSTR("<EFBFBD>"));
|
||||
tooWide = StringWidth(theStr) > wide;
|
||||
dotsWide = surface->MeasureString(PSTR("<EFBFBD>"));
|
||||
tooWide = surface->MeasureString(theStr) > wide;
|
||||
while (tooWide)
|
||||
{
|
||||
theStr[0]--;
|
||||
tooWide = ((StringWidth(theStr) + dotsWide) > wide);
|
||||
tooWide = ((surface->MeasureString(theStr) + dotsWide) > wide);
|
||||
if (!tooWide)
|
||||
PasStringConcat(theStr, PSTR("<EFBFBD>"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user