mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
Finish removing QDState
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "PLPasStr.h"
|
||||
#include "Externs.h"
|
||||
#include "RenderedFont.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -275,17 +276,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 (DrawSurface *surface, StringPtr theStr, short wide)
|
||||
void CollapseStringToWidth (PortabilityLayer::RenderedFont *font, StringPtr theStr, short wide)
|
||||
{
|
||||
short dotsWide;
|
||||
Boolean tooWide;
|
||||
|
||||
dotsWide = surface->MeasureString(PSTR("<EFBFBD>"));
|
||||
tooWide = surface->MeasureString(theStr) > wide;
|
||||
while (tooWide)
|
||||
dotsWide = font->MeasurePStr(PSTR("<EFBFBD>"));
|
||||
tooWide = font->MeasurePStr(theStr) > wide;
|
||||
while (tooWide && theStr[0] > 0)
|
||||
{
|
||||
theStr[0]--;
|
||||
tooWide = ((surface->MeasureString(theStr) + dotsWide) > wide);
|
||||
tooWide = ((font->MeasurePStr(theStr) + dotsWide) > wide);
|
||||
if (!tooWide)
|
||||
PasStringConcat(theStr, PSTR("<EFBFBD>"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user