summaryrefslogtreecommitdiff
path: root/plugingui/drumkitframecontent.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/drumkitframecontent.cc
parenta3dc9bd19f976cbc84ba3d1a16c72257b42b28ba (diff)
Make sure we don't resize to negative values.
Diffstat (limited to 'plugingui/drumkitframecontent.cc')
-rw-r--r--plugingui/drumkitframecontent.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugingui/drumkitframecontent.cc b/plugingui/drumkitframecontent.cc
index f90f346..d58f7b4 100644
--- a/plugingui/drumkitframecontent.cc
+++ b/plugingui/drumkitframecontent.cc
@@ -51,8 +51,8 @@ void BrowseFile::resize(std::size_t width, std::size_t height)
{
Widget::resize(width, height);
- lineedit_width = 0.77 * width - gap;
- button_width = width - lineedit_width - gap;
+ lineedit_width = std::max((int)(0.77 * (int)width - gap), 0);
+ button_width = std::max((int)width - lineedit_width - gap, 0);
lineedit.resize(lineedit_width, 29);
browse_button.resize(button_width, 30);