Fixed GuiBox/GuiFastSelect render order.

This commit is contained in:
Aloshi 2012-10-10 08:56:34 -05:00
parent b6afbd8c09
commit b6264f4858
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
October 10
-Added a theming tag for the Fast Select box's text.
-Fixed GuiBox background being positioned wrong.
-Fixed GuiBox/GuiFastSelect render order.
October 7
-Fixed borders for GuiBox. The right and bottom borders are flipped, too.

View file

@ -25,7 +25,7 @@ GuiFastSelect::GuiFastSelect(GuiComponent* parent, GuiList<FileData*>* list, cha
unsigned int sw = Renderer::getScreenWidth(), sh = Renderer::getScreenHeight();
mBox = new GuiBox(sw * 0.2, sh * 0.2, sw * 0.6, sh * 0.6);
mBox->setData(data);
addChild(mBox);
//addChild(mBox);
mTextColor = textcolor;
@ -37,7 +37,6 @@ GuiFastSelect::~GuiFastSelect()
Renderer::unregisterComponent(this);
InputManager::unregisterComponent(this);
removeChild(mBox);
delete mBox;
mParent->resume();
@ -50,6 +49,8 @@ void GuiFastSelect::onRender()
if(!mBox->hasBackground())
Renderer::drawRect(sw * 0.2, sh * 0.2, sw * 0.6, sh * 0.6, 0x000FF0);
mBox->render();
Renderer::drawCenteredText(LETTERS.substr(mLetterID, 1), 0, sh * 0.5 - (Renderer::getFontHeight(Renderer::LARGE) * 0.5), mTextColor, Renderer::LARGE);
}