mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Minor fixes.
This commit is contained in:
parent
d0ff61807d
commit
88b4d69afa
@ -400,7 +400,7 @@ void CMessage::drawIWindow(CInfoWindow * ret, std::string text, int player, int
|
||||
if(dynamic_cast<CSelWindow*>(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
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user