diff --git a/client/CMessage.cpp b/client/CMessage.cpp index b06923936..de6fed062 100644 --- a/client/CMessage.cpp +++ b/client/CMessage.cpp @@ -400,7 +400,7 @@ void CMessage::drawIWindow(CInfoWindow * ret, std::string text, int player, int if(dynamic_cast(ret)) //it's selection window, so we'll blit "or" between components _or = FNT_RenderText(FONT_MEDIUM,CGI->generaltexth->allTexts[4],zwykly); - const int sizes[][2] = {{400, 100}, {500, 150}, {600, 200}}; + const int sizes[][2] = {{400, 125}, {500, 150}, {600, 200}}; for(int i = 0; i < ARRAY_COUNT(sizes) && sizes[i][0] < conf.cc.resx - 150 diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 092ad9e44..08927baf8 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -5615,7 +5615,7 @@ void CTextBox::showAll(SDL_Surface * to) int dy = f.height; //line height int base_y = pos.y; if(alignment == CENTER) - base_y += (pos.h - maxH)/2; + base_y += std::max((pos.h - maxH)/2,0); int howManyLinesToPrint = slider ? slider->capacity : lines.size(); int firstLineToPrint = slider ? slider->value : 0; @@ -5625,9 +5625,13 @@ void CTextBox::showAll(SDL_Surface * to) const std::string &line = lines[i + firstLineToPrint]; int x = pos.x; if(alignment == CENTER) + { x += (pos.w - f.getWidth(line.c_str())) / 2; + if(slider) + x -= slider->pos.w / 2 + 5; + } - printAt(line, pos.x, base_y + i*dy, font, color, to); + printAt(line, x, base_y + i*dy, font, color, to); } } @@ -5640,6 +5644,9 @@ void CTextBox::setTxt(const std::string &Txt) void CTextBox::sliderMoved(int to) { + if(!slider) + return; + if(redrawParentOnScrolling) parent->redraw(); redraw();