mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:38:10 +00:00
LibGUI: GTabWidget should not set children to have negative size
This could happen if a child was added to a GTabWidget before the GTabWidget had its first layout. Also add an assertion to catch this in GWidget::set_relative_rect() since it was not immediately obvious what was happening.
This commit is contained in:
parent
93dff5df34
commit
b916e34fed
2 changed files with 10 additions and 3 deletions
|
@ -44,6 +44,8 @@ void GWidget::child_event(CChildEvent& event)
|
|||
|
||||
void GWidget::set_relative_rect(const Rect& rect)
|
||||
{
|
||||
ASSERT(rect.width() >= 0 && rect.height() >= 0);
|
||||
|
||||
if (rect == m_relative_rect)
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue