ALso correct scrollbar calc to not clip division remainder
from the displayed area. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
bc03601097
commit
bf06fe48ad
@ -652,7 +652,8 @@ void wxScrollHelper::AdjustScrollbars()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_xScrollLines = m_targetWindow->GetVirtualSize().GetWidth() / m_xScrollPixelsPerLine;
|
int vVirt = m_targetWindow->GetVirtualSize().GetWidth();
|
||||||
|
m_xScrollLines = (vVirt+m_xScrollPixelsPerLine-1) / m_xScrollPixelsPerLine;
|
||||||
|
|
||||||
// Calculate page size i.e. number of scroll units you get on the
|
// Calculate page size i.e. number of scroll units you get on the
|
||||||
// current client window
|
// current client window
|
||||||
@ -686,7 +687,7 @@ void wxScrollHelper::AdjustScrollbars()
|
|||||||
else // might need scrolling
|
else // might need scrolling
|
||||||
{
|
{
|
||||||
int hVirt = m_targetWindow->GetVirtualSize().GetHeight();
|
int hVirt = m_targetWindow->GetVirtualSize().GetHeight();
|
||||||
m_yScrollLines = hVirt / m_yScrollPixelsPerLine;
|
m_yScrollLines = (hVirt+m_yScrollPixelsPerLine-1) / m_yScrollPixelsPerLine;
|
||||||
|
|
||||||
// Calculate page size i.e. number of scroll units you get on the
|
// Calculate page size i.e. number of scroll units you get on the
|
||||||
// current client window
|
// current client window
|
||||||
|
Loading…
Reference in New Issue
Block a user