JANITORIAL: Fix code formatting
This commit is contained in:
parent
1f721e929f
commit
ca55163ea1
1 changed files with 5 additions and 3 deletions
|
@ -121,8 +121,10 @@ void MacText::render(int from, int to) {
|
||||||
|
|
||||||
for (int i = from; i < to; i++) {
|
for (int i = from; i < to; i++) {
|
||||||
int xOffset = 0;
|
int xOffset = 0;
|
||||||
if (_textAlignment == kTextAlignRight) xOffset = _textMaxWidth - _font->getStringWidth(_text[i]);
|
if (_textAlignment == kTextAlignRight)
|
||||||
else if (_textAlignment == kTextAlignCenter) xOffset = (_textMaxWidth / 2) - (_font->getStringWidth(_text[i]) / 2);
|
xOffset = _textMaxWidth - _font->getStringWidth(_text[i]);
|
||||||
|
else if (_textAlignment == kTextAlignCenter)
|
||||||
|
xOffset = (_textMaxWidth / 2) - (_font->getStringWidth(_text[i]) / 2);
|
||||||
|
|
||||||
//TODO: _textMaxWidth, when -1, was not rendering ANY text.
|
//TODO: _textMaxWidth, when -1, was not rendering ANY text.
|
||||||
_font->drawString(_surface, _text[i], xOffset, y, _maxWidth, _fgcolor);
|
_font->drawString(_surface, _text[i], xOffset, y, _maxWidth, _fgcolor);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue