Fixed bug in scalable font, that was visible in the tooltip
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7990 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
2c565911b1
commit
392bfe3e9c
@ -505,7 +505,7 @@ void ScalableFont::draw(const core::stringw& text,
|
|||||||
c == L'\n' ) // Unix breaks
|
c == L'\n' ) // Unix breaks
|
||||||
{
|
{
|
||||||
if(c==L'\r' && text[i+1]==L'\n') c = text[++i];
|
if(c==L'\r' && text[i+1]==L'\n') c = text[++i];
|
||||||
offset.Y += MaxHeight;
|
offset.Y += MaxHeight*m_scale;
|
||||||
offset.X = position.UpperLeftCorner.X;
|
offset.X = position.UpperLeftCorner.X;
|
||||||
if (hcenter)
|
if (hcenter)
|
||||||
offset.X += (position.getWidth() - text_dimension.Width) >> 1;
|
offset.X += (position.getWidth() - text_dimension.Width) >> 1;
|
||||||
|
@ -1375,7 +1375,7 @@ void Skin::drawTooltip(Widget* widget)
|
|||||||
irr::gui::ScalableFont* font = GUIEngine::getSmallFont();
|
irr::gui::ScalableFont* font = GUIEngine::getSmallFont();
|
||||||
core::dimension2d<u32> size = font->getDimension(widget->getTooltipText().c_str());
|
core::dimension2d<u32> size = font->getDimension(widget->getTooltipText().c_str());
|
||||||
core::position2di pos(widget->m_x + 15, widget->m_y + widget->m_h);
|
core::position2di pos(widget->m_x + 15, widget->m_y + widget->m_h);
|
||||||
core::rect<s32> r(pos, size + core::dimension2d<u32>(0,15));
|
core::rect<s32> r(pos, size);
|
||||||
GUIEngine::getDriver()->draw2DRectangle( video::SColor(255, 200, 200, 200), r );
|
GUIEngine::getDriver()->draw2DRectangle( video::SColor(255, 200, 200, 200), r );
|
||||||
font->draw(widget->getTooltipText(), r, video::SColor(255, 0, 0, 0), false, false);
|
font->draw(widget->getTooltipText(), r, video::SColor(255, 0, 0, 0), false, false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user