Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/IGUITextOwner.cpp
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void IGUITextOwner::CalculateTextPosition(CRect& ObjSize, CPos& TextPos, CGUIText& Text) | void IGUITextOwner::CalculateTextPosition(CRect& ObjSize, CPos& TextPos, CGUIText& Text) | ||||
{ | { | ||||
// The horizontal Alignment is now computed in GenerateText in order to not have to | // The horizontal Alignment is now computed in GenerateText in order to not have to | ||||
// loop through all of the TextCall objects again. | // loop through all of the TextCall objects again. | ||||
TextPos.x = ObjSize.left; | TextPos.x = ObjSize.left; | ||||
switch (GUI<EVAlign>::GetSetting(this, "text_valign")) | switch (GetSetting<EVAlign>("text_valign")) | ||||
{ | { | ||||
case EVAlign_Top: | case EVAlign_Top: | ||||
TextPos.y = ObjSize.top; | TextPos.y = ObjSize.top; | ||||
break; | break; | ||||
case EVAlign_Center: | case EVAlign_Center: | ||||
// Round to integer pixel values, else the fonts look awful | // Round to integer pixel values, else the fonts look awful | ||||
TextPos.y = floorf(ObjSize.CenterPoint().y - Text.GetSize().cy / 2.f); | TextPos.y = floorf(ObjSize.CenterPoint().y - Text.GetSize().cy / 2.f); | ||||
break; | break; | ||||
Show All 28 Lines |
Wildfire Games · Phabricator