From b916e34fed9148cce5cab1f0c1691e0d2c967675 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 23 Oct 2019 19:51:09 +0200 Subject: 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. --- Libraries/LibGUI/GWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Libraries/LibGUI/GWidget.cpp') 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; -- cgit v1.2.3