mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-10-06 07:00:16 +08:00
Increase usable scrolling range in wxMSW by a factor of 10,000
Using GDI functions for the device origin translation limits the scrolling range to 2^27 size of the device space in the controls using PrepareDC(), as it works by adjusting the device origin, and this may be too small when having many (millions) of rows, which is perfectly possible with wxDataViewCtrl or wxGrid, for example. So handle DC device origin translations ourselves in wxMSW, i.e. offset the coordinates by device origin before passing them to the native functions as this allows to use the full 32-bit range. Closes #17550.
This commit is contained in:
+88
-37
File diff suppressed because it is too large
Load Diff
@@ -103,8 +103,16 @@ protected:
|
||||
// adjusted for the given wxDC.
|
||||
static RECT ConvertToRECT(wxDC& dc, const wxRect& rect)
|
||||
{
|
||||
// Theme API doesn't know anything about GDI+ transforms, so apply them
|
||||
// manually.
|
||||
wxRect rectDevice = dc.GetImpl()->MSWApplyGDIPlusTransform(rect);
|
||||
|
||||
// We also need to handle the origin offset manually as we don't use
|
||||
// Windows support for this, see wxDC code.
|
||||
rectDevice.Offset(dc.GetDeviceOrigin());
|
||||
|
||||
RECT rc;
|
||||
wxCopyRectToRECT(dc.GetImpl()->MSWApplyGDIPlusTransform(rect), rc);
|
||||
wxCopyRectToRECT(rectDevice, rc);
|
||||
return rc;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user