Applied patch [ 648042 ] Erase background error
When erasing the background with a transparent background the logical origin of the provided DC is (re) set, but not restored to the old value. Restoring the old value is needed because the DC is/can be shared with the real draw code... This patch solves problems like mentioned in bug report #635217 and problems like controls (like radio controls etc) that disappear when moving the mouse over them or clicking on them... Hans Van Leemputten git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -284,10 +284,10 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
|
|||||||
AdjustForParentClientOrigin( pos.x, pos.y, 0 );
|
AdjustForParentClientOrigin( pos.x, pos.y, 0 );
|
||||||
|
|
||||||
// Adjust DC logical origin
|
// Adjust DC logical origin
|
||||||
wxCoord x,y;
|
wxCoord org_x, org_y, x, y;
|
||||||
dc.GetLogicalOrigin( &x, &y );
|
dc.GetLogicalOrigin( &org_x, &org_y );
|
||||||
x += pos.x;
|
x = org_x + pos.x;
|
||||||
y += pos.y;
|
y = org_y + pos.y;
|
||||||
dc.SetLogicalOrigin( x, y );
|
dc.SetLogicalOrigin( x, y );
|
||||||
|
|
||||||
// Adjust draw rect
|
// Adjust draw rect
|
||||||
@@ -296,6 +296,9 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
|
|||||||
|
|
||||||
// Let parent draw the background
|
// Let parent draw the background
|
||||||
parent->EraseBackground( dc, rect );
|
parent->EraseBackground( dc, rect );
|
||||||
|
|
||||||
|
// Restore DC logical origin
|
||||||
|
dc.SetLogicalOrigin( org_x, org_y );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user