From 99a9f8a7e586e5fddcc01c2ae2d3fe3bc039253c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 27 Oct 2016 11:02:18 +0200 Subject: [PATCH] - textbox: fix lineBreakWidth calculation --- src/gui/widget/textbox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index a4f719240..5091a2086 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -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)