hintbox: fix getMaxWidth

Origin commit data
------------------
Commit: 406e051bd9
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-02-04 (Tue, 04 Feb 2020)
This commit is contained in:
Jacek Jendrzej
2020-02-04 22:17:59 +01:00
committed by vanhofen
parent 370167afd5
commit 5d4076bc72

View File

@@ -444,7 +444,8 @@ int CHintBox::getMaxWidth(const string& Text, const string& Title, Font *font, c
int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth())));
if (ccw_show_header){
initHeader();
return max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation);
int max_title_width = max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation);
return min(max_title_width, (int)frameBuffer->getScreenWidth());
}
return res;