summaryrefslogtreecommitdiff
path: root/plugingui/textedit.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/textedit.cc
parenta3dc9bd19f976cbc84ba3d1a16c72257b42b28ba (diff)
Make sure we don't resize to negative values.
Diffstat (limited to 'plugingui/textedit.cc')
-rw-r--r--plugingui/textedit.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugingui/textedit.cc b/plugingui/textedit.cc
index ebe8d32..fd2f891 100644
--- a/plugingui/textedit.cc
+++ b/plugingui/textedit.cc
@@ -50,7 +50,7 @@ void TextEdit::resize(std::size_t width, std::size_t height)
needs_preprocessing = true;
scroll.move(width - 2*x_border - 3, y_border - 1);
- scroll.resize(scroll.width(), height - 2*(y_border - 1));
+ scroll.resize(scroll.width(), std::max((int)height - 2*(y_border - 1), 0));
}
void TextEdit::setReadOnly(bool readonly)