src/gui/widget/textbox.cpp supplement to try to fix text lines per page

This commit is contained in:
Jacek Jendrzej
2016-11-03 12:51:31 +01:00
parent d6c4324f6c
commit e26ad6e9f1

View File

@@ -310,8 +310,9 @@ void CTextBox::initFramesRel(void)
m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth;
m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight);
if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight)
int lines_per_page_tmp = (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight;
m_nLinesPerPage = std::max(1,lines_per_page_tmp);
if(lines_per_page_tmp && (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight)
m_nLinesPerPage += 1;
#if 0
@@ -467,8 +468,9 @@ void CTextBox::refreshTextLineArray(void)
reSizeMainFrameHeight(m_nNrOfLines * m_nFontTextHeight);
}
m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight);
if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight)
int lines_per_page_tmp = (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight;
m_nLinesPerPage = std::max(1, lines_per_page_tmp);
if(lines_per_page_tmp && (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight)
m_nLinesPerPage += 1;
m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1;