More RTL fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -936,7 +936,33 @@ void wxScrollHelper::GetViewStart (int *x, int *y) const
|
||||
void wxScrollHelper::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{
|
||||
if ( xx )
|
||||
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||
{
|
||||
if ((m_xScrollLines == 0) || (m_xScrollPixelsPerLine == 0))
|
||||
{
|
||||
// nothing to do
|
||||
*xx = x;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
if (m_win->GetLayoutDirection() == wxLayout_RightToLeft)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
GetTargetSize(&w, &h);
|
||||
|
||||
// Calculate page size i.e. number of scroll units you get on the
|
||||
// current client window
|
||||
int noPagePositions = w/m_xScrollPixelsPerLine;
|
||||
if (noPagePositions < 1) noPagePositions = 1;
|
||||
*xx = x - ((m_xScrollLines - noPagePositions - m_xScrollPosition) * m_xScrollPixelsPerLine);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( yy )
|
||||
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
||||
}
|
||||
@@ -944,7 +970,33 @@ void wxScrollHelper::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) cons
|
||||
void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{
|
||||
if ( xx )
|
||||
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||
{
|
||||
if ((m_xScrollLines == 0) || (m_xScrollPixelsPerLine == 0))
|
||||
{
|
||||
// nothing to do
|
||||
*xx = x;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
if (m_win->GetLayoutDirection() == wxLayout_RightToLeft)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
GetTargetSize(&w, &h);
|
||||
|
||||
// Calculate page size i.e. number of scroll units you get on the
|
||||
// current client window
|
||||
int noPagePositions = w/m_xScrollPixelsPerLine;
|
||||
if (noPagePositions < 1) noPagePositions = 1;
|
||||
*xx = x + ((m_xScrollLines - noPagePositions - m_xScrollPosition) * m_xScrollPixelsPerLine);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( yy )
|
||||
*yy = y + m_yScrollPosition * m_yScrollPixelsPerLine;
|
||||
}
|
||||
|
Reference in New Issue
Block a user