textbox: fix lineBreakWidth calculation

Origin commit data
------------------
Commit: 99a9f8a7e5
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-10-27 (Thu, 27 Oct 2016)

Origin message was:
------------------
- textbox: fix lineBreakWidth calculation
This commit is contained in:
vanhofen
2016-10-27 11:02:18 +02:00
parent 2d6f298423
commit 1a89ed0d87

View File

@@ -353,12 +353,13 @@ void CTextBox::refreshTextLineArray(void)
m_cLineArray.clear();
m_nNrOfLines = 0;
int MaxWidth = m_nMaxWidth - m_cFrameScrollRel.iWidth - 2*text_Hborder_width;
if( m_nMode & AUTO_WIDTH){
/* In case of autowidth, we calculate the max allowed width of the textbox */
lineBreakWidth = m_nMaxWidth - m_cFrameScrollRel.iWidth - 2*text_Hborder_width;
lineBreakWidth = MaxWidth;
}else{
/* If not autowidth, we just take the actuall textframe width */
lineBreakWidth = std::max(m_nMaxWidth, m_cFrameTextRel.iWidth - 2*text_Hborder_width);
lineBreakWidth = std::max(MaxWidth, m_cFrameTextRel.iWidth - 2*text_Hborder_width);
}
if(m_nMaxTextWidth)