Account for scrolling when setting the background brush origin in wxMSW.
We must use physical coordinates for the brush origin to account for the coordinates offset in scrolled windows, so add MSWAdjustBrushOrg() and call it from MSWGetBgBrushForChild(). Closes #14917. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4959,7 +4959,11 @@ wxWindowMSW::MSWGetBgBrushForChild(WXHDC hDC, wxWindowMSW *child)
|
||||
|
||||
::MapWindowPoints(NULL, GetHwnd(), (POINT *)&rc, 1);
|
||||
|
||||
if ( !::SetBrushOrgEx((HDC)hDC, -rc.left, -rc.top, NULL) )
|
||||
int x = rc.left,
|
||||
y = rc.top;
|
||||
MSWAdjustBrushOrg(&x, &y);
|
||||
|
||||
if ( !::SetBrushOrgEx((HDC)hDC, -x, -y, NULL) )
|
||||
{
|
||||
wxLogLastError(wxT("SetBrushOrgEx(bg brush)"));
|
||||
}
|
||||
|
Reference in New Issue
Block a user