Some fixes to my GUI Engine additions, so that they are compatible with the rest of the game.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13377 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx
2013-07-28 19:31:17 +00:00
parent 1d90f554e8
commit 8c1d84ce74
2 changed files with 3 additions and 3 deletions

View File

@@ -187,7 +187,8 @@ void ModalDialog::dismiss()
{
if(modalWindow != NULL) delete modalWindow;
modalWindow = NULL;
GUIEngine::getCurrentScreen()->onDialogClose();
if(GUIEngine::getCurrentScreen() != NULL)
GUIEngine::getCurrentScreen()->onDialogClose();
}
// ----------------------------------------------------------------------------

View File

@@ -128,12 +128,11 @@ void LabelWidget::add()
void LabelWidget::setText(const wchar_t *text, bool expandIfNeeded)
{
assert(m_element != NULL);
m_scroll_offset = 0;
if (expandIfNeeded)
{
assert(m_element != NULL);
const int fwidth = (m_title_font ? GUIEngine::getTitleFont() : GUIEngine::getFont())->getDimension(text).Width;
core::rect<s32> rect = m_element->getRelativePosition();