Tweak tooltip to only display if the mouse is actually over the checkbox

This commit is contained in:
Marianne Gagnon 2015-03-10 19:56:10 -04:00
parent 9d5c735ccb
commit ce9ba74f57

View File

@ -1609,11 +1609,18 @@ void Skin::drawCheckBox(const core::recti &rect, Widget* widget, bool focused)
true /* alpha */);
}
if (focused && widget->hasTooltip())
{
const core::position2di mouse_position =
irr_driver->getDevice()->getCursorControl()->getPosition();
if (rect.isPointInside(mouse_position))
{
m_tooltip_at_mouse.push_back(true);
m_tooltips.push_back(widget);
}
}
} // drawCheckBox
// ----------------------------------------------------------------------------