summaryrefslogtreecommitdiff
path: root/plugingui/frame.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-05-19 19:09:17 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-05-19 19:09:17 +0200
commitff83cfac10939ceba524c93d4e36f634f4bec805 (patch)
treed481913f2136bf04d2d1deb650e6bd084a531676 /plugingui/frame.cc
parenta3dc9bd19f976cbc84ba3d1a16c72257b42b28ba (diff)
Make sure we don't resize to negative values.
Diffstat (limited to 'plugingui/frame.cc')
-rw-r--r--plugingui/frame.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugingui/frame.cc b/plugingui/frame.cc
index efe0281..81cc3c2 100644
--- a/plugingui/frame.cc
+++ b/plugingui/frame.cc
@@ -110,8 +110,8 @@ void FrameWidget::sizeChanged(int width, int height)
{
content_start_x = content_margin;
content_start_y = bar_height + content_margin;
- content_width = width - 2 * content_margin;
- content_height = height - (bar_height + 2 * content_margin);
+ content_width = std::max((int)width - 2 * content_margin, 0);
+ content_height = std::max((int)height - (bar_height + 2 * content_margin), 0);
content->move(content_start_x, content_start_y);
content->resize(content_width, content_height);