- textbox: fix lineBreakWidth calculation

This commit is contained in:
svenhoefer
2016-10-27 11:02:18 +02:00
parent 48c596e2ca
commit 99a9f8a7e5

View File

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