From ff83cfac10939ceba524c93d4e36f634f4bec805 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 19 May 2017 19:09:17 +0200 Subject: Make sure we don't resize to negative values. --- plugingui/lineedit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugingui/lineedit.cc') diff --git a/plugingui/lineedit.cc b/plugingui/lineedit.cc index 96bf56f..5dd8bc5 100644 --- a/plugingui/lineedit.cc +++ b/plugingui/lineedit.cc @@ -237,7 +237,7 @@ void LineEdit::repaintEvent(RepaintEvent *repaintEvent) while(true) { int textWidth = font.textWidth(visibleText); - if(textWidth <= (w - BORDER - 4 + 3)) + if(textWidth <= std::max(w - BORDER - 4 + 3, 0)) { break; } -- cgit v1.2.3