From d6c4324f6c91cd8f8eaaf10b3d7695882f93a18d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 12:17:11 +0100 Subject: [PATCH 1/4] src/gui/widget/textbox.cpp try to fix text lines per page --- src/gui/widget/textbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 7120b7a16..5651d302c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -311,6 +311,8 @@ 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) + m_nLinesPerPage += 1; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tScroll:\t%3d,%3d,%3d,%3d \r\n", @@ -466,6 +468,8 @@ void CTextBox::refreshTextLineArray(void) } m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) + m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; if(m_nCurrentPage >= m_nNrOfPages) From e26ad6e9f1970d82d5a2b80315acf67b526c228e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 12:51:31 +0100 Subject: [PATCH 2/4] src/gui/widget/textbox.cpp supplement to try to fix text lines per page --- src/gui/widget/textbox.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 5651d302c..428063a4f 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -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; From 3815694e391025ae44ff21f75d5942cd83a796e5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 18:38:14 +0100 Subject: [PATCH 3/4] Revert "src/gui/widget/textbox.cpp supplement to try to fix text lines per page" This reverts commit e26ad6e9f1970d82d5a2b80315acf67b526c228e. --- src/gui/widget/textbox.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 428063a4f..5651d302c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -310,9 +310,8 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth; - 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 = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) m_nLinesPerPage += 1; #if 0 @@ -468,9 +467,8 @@ void CTextBox::refreshTextLineArray(void) reSizeMainFrameHeight(m_nNrOfLines * 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 = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); + if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; From 2907aa5a37ebe4aaeb287101ce8e3a5c3fcb7bbc Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 3 Nov 2016 18:38:41 +0100 Subject: [PATCH 4/4] Revert "src/gui/widget/textbox.cpp try to fix text lines per page" This reverts commit d6c4324f6c91cd8f8eaaf10b3d7695882f93a18d. --- src/gui/widget/textbox.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 5651d302c..7120b7a16 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -311,8 +311,6 @@ 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) - m_nLinesPerPage += 1; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tScroll:\t%3d,%3d,%3d,%3d \r\n", @@ -468,8 +466,6 @@ void CTextBox::refreshTextLineArray(void) } m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight); - if((m_cFrameTextRel.iHeight - (2*text_Vborder_width)) % m_nFontTextHeight) - m_nLinesPerPage += 1; m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1; if(m_nCurrentPage >= m_nNrOfPages)