1
0
Fork 0

Merge branch 'jmt/gpswidget' into next

This commit is contained in:
Tim Moore 2010-02-23 08:53:58 +01:00
commit 51846e5129

View file

@ -108,15 +108,14 @@ static void drawClippedString(puFont& font, const char* s, int x, int y, int max
return;
}
int len = strlen(s);
char buf[len];
memcpy(buf, s, len);
std::string buf(s);
int len = buf.size();
do {
buf[--len] = 0;
fullWidth = font.getStringWidth(buf);
buf.resize(--len);
fullWidth = font.getStringWidth(buf.c_str());
} while (fullWidth > maxWidth);
font.drawString(buf, x, y);
font.drawString(buf.c_str(), x, y);
}
//////////////////////////////////////////////////////////////////////////////