summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GWidget.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-23 19:51:09 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-23 19:51:09 +0200
commitb916e34fed9148cce5cab1f0c1691e0d2c967675 (patch)
tree271f0731c74e5233e7bee8b903abbc9b15644f69 /Libraries/LibGUI/GWidget.cpp
parent93dff5df34bd03e2d8ab50de20d191b2eebf43f0 (diff)
downloadserenity-b916e34fed9148cce5cab1f0c1691e0d2c967675.zip
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.
Diffstat (limited to 'Libraries/LibGUI/GWidget.cpp')
-rw-r--r--Libraries/LibGUI/GWidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GWidget.cpp b/Libraries/LibGUI/GWidget.cpp
index ae7f1a0c3a..a89c1062cf 100644
--- a/Libraries/LibGUI/GWidget.cpp
+++ b/Libraries/LibGUI/GWidget.cpp
@@ -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;