- const Font *ft = style()->getFont();
- unsigned int sidemargin = style()->getBevelWidth() * 2;
-
- ustring t = _text; // the actual text to draw
- int x = sidemargin; // x coord for the text
-
- // find a string that will fit inside the area for text
- int max_length = width() - sidemargin * 2;
- if (max_length <= 0) {
- t = ""; // can't fit anything
- } else {
- size_t text_len = t.size();
- int length;
+ const RenderControl *control = display->renderControl(screen());
+ unsigned int sidemargin = bevel() * 2;
+ int y = bevel();
+ unsigned int w = area().width() - borderWidth() * 2 - sidemargin * 2;
+ unsigned int h = area().height() - borderWidth() * 2 - bevel() * 2;
+
+ switch (_justify_vert) {
+ case RenderStyle::RightBottomJustify:
+ y += h - (_parsedtext.size() * _font->height());
+ if (y < bevel()) y = bevel();
+ break;
+ case RenderStyle::CenterJustify:
+ y += (h - (_parsedtext.size() * _font->height())) / 2;
+ if (y < bevel()) y = bevel();
+ break;
+ case RenderStyle::LeftTopJustify:
+ break;
+ }
+
+ if (w <= 0) return; // can't fit anything
+
+ std::vector<ustring>::iterator it, end = _parsedtext.end();
+ for (it = _parsedtext.begin(); it != end; ++it, y += _font->height()) {
+ ustring t = *it; // the actual text to draw
+ int x = sidemargin; // x coord for the text
+
+ // find a string that will fit inside the area for text
+ ustring::size_type text_len = t.size();
+ unsigned int length;