Fixed bug in previous commit, oops

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8118 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-03-30 13:44:53 +00:00
parent 1ba9c8f6e7
commit 3be02f1bc4

View File

@ -101,17 +101,20 @@ void LabelWidget::add()
m_element->setTabStop(false); m_element->setTabStop(false);
m_element->setTabGroup(false); m_element->setTabGroup(false);
if (!m_scroll_offset)
{
m_element->setNotClipped(true);
}
if (m_scroll_speed > 0) if (m_scroll_speed > 0)
{ {
IGUIFont* font = m_title_font ? GUIEngine::getTitleFont() IGUIFont* font = m_title_font ? GUIEngine::getTitleFont()
: GUIEngine::getFont(); : GUIEngine::getFont();
core::dimension2du r = font->getDimension(getText().c_str()); core::dimension2du r = font->getDimension(getText().c_str());
m_scroll_offset = (float)r.Width;
//m_scroll_offset = (float)r.Width;
// start scrolled off
m_scroll_offset = (float)(-m_element->getAbsolutePosition().getWidth()-10);
}
else
{
m_element->setNotClipped(true);
} }
} // add } // add
@ -176,8 +179,7 @@ bool LabelWidget::scrolledOff() const
/** Sets horizontal scroll speed. */ /** Sets horizontal scroll speed. */
void LabelWidget::setScrollSpeed(float speed) void LabelWidget::setScrollSpeed(float speed)
{ {
// start scrolled off m_scroll_offset = 0;
m_scroll_offset = (float)(-m_element->getAbsolutePosition().getWidth()-10);
m_scroll_speed = speed; m_scroll_speed = speed;
} // setScrollSpeed } // setScrollSpeed