From 6603d1126e42803e7d5c72bb7f280c05a1337f4f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 17 Sep 2017 21:50:59 +0200 Subject: [PATCH] CHintBox: fix possible unintended cut of text Last line size was not considered. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/87b53a85979678979679b93d88383d504ea2e455 Author: Thilo Graf Date: 2017-09-17 (Sun, 17 Sep 2017) --- src/gui/widget/hintbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index e0b6bfd4c..c08b31be5 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -268,7 +268,8 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const /* pre define required info height depends of lines and minimal needed height*/ int line_breaks = CTextBox::getLines(Text); int h_font = item_font->getHeight(); - int h_lines = h_font * line_breaks; + int h_lines = h_font; + h_lines += h_font * line_breaks; /* get required height depends of possible lines and max height */ h_hint_obj = min(HINTBOX_MAX_HEIGHT - (ccw_head ? ccw_head->getHeight() : 0), h_lines + 2*w_indentation);