hintbox: supplement to fix getMaxWidth, hintbox have shadow default ON and shadow is added to width in cc_item (dx+sw). This break RestoreScreen

Origin commit data
------------------
Branch: ni/coolstream
Commit: e6ae6124b1
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2020-02-04 (Tue, 04 Feb 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2020-02-04 22:17:59 +01:00
committed by vanhofen
parent 49ad101c64
commit b86833845c

View File

@@ -441,11 +441,11 @@ void CHintBox::scroll_down(const uint& hint_id)
int CHintBox::getMaxWidth(const string& Text, const string& Title, Font *font, const int& minWidth)
{
int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth())));
int res = max(HINTBOX_MIN_WIDTH, max(minWidth+2*w_indentation, min(CTextBox::getMaxLineWidth(Text, font)+2*w_indentation, (int)frameBuffer->getScreenWidth() - shadow_w)));
if (ccw_show_header){
initHeader();
int max_title_width = max(res, ccw_head->getCaptionFont()->getRenderWidth(Title) + 2*w_indentation);
return min(max_title_width, (int)frameBuffer->getScreenWidth());
return min(max_title_width, (int)frameBuffer->getScreenWidth() - shadow_w);
}
return res;