GUI: Add checks in Widget::getBossClipRect()

Prints a warning if clipping area is invalid and fixes it.
This commit is contained in:
Alexander Tkachev 2016-07-02 14:35:37 +06:00 committed by Eugene Sandulenko
parent 6de5324742
commit 846619fd42
3 changed files with 26 additions and 20 deletions

View file

@ -44,21 +44,6 @@ void GuiObject::reflowLayout() {
if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) {
error("Could not load widget position for '%s'", _name.c_str());
}
/*
if (_x < 0)
error("Widget <%s> has x < 0 (%d)", _name.c_str(), _x);
if (_x >= g_gui.getWidth())
error("Widget <%s> has x > %d (%d)", _name.c_str(), g_gui.getWidth(), _x);
if (_x + _w > g_gui.getWidth())
error("Widget <%s> has x + w > %d (%d)", _name.c_str(), g_gui.getWidth(), _x + _w);
if (_y < 0)
error("Widget <%s> has y < 0 (%d)", _name.c_str(), _y);
if (_y >= g_gui.getHeight())
error("Widget <%s> has y > %d (%d)", _name.c_str(), g_gui.getHeight(), _y);
if (_y + _h > g_gui.getHeight())
error("Widget <%s> has y + h > %d (%d)", _name.c_str(), g_gui.getHeight(), _y + _h);
*/
}
}