- do {
- t.resize(text_len);
- length = font->measureString(t); // this returns an unsigned, so check < 0
- if (length < 0) length = maxsize; // if the string's that long just adjust
- } while (length > maxsize && text_len-- > 0);
-
- if (text_len <= 0) return; // won't fit anything
-
- // justify the text
- switch (style->labelTextJustify()) {
- case otk::RenderStyle::RightBottomJustify:
- x += maxsize - length;
- break;
- case otk::RenderStyle::CenterJustify:
- x += (maxsize - length) / 2;
- break;
- case otk::RenderStyle::LeftTopJustify:
- break;
- }
+ do {
+ t.resize(text_len);
+ length = font->measureString(t);// this returns an unsigned, so check < 0
+ if (length < 0) length = maxsize;// if the string's that long just adjust
+ } while (length > maxsize && text_len-- > 0);
+
+ // justify the text
+ switch (style->labelTextJustify()) {
+ case otk::RenderStyle::RightBottomJustify:
+ x += maxsize - length;
+ break;
+ case otk::RenderStyle::CenterJustify:
+ x += (maxsize - length) / 2;
+ break;
+ case otk::RenderStyle::LeftTopJustify:
+ break;
+ }