]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/winuniv.cpp
made the #error message less self-contradictory
[wxWidgets.git] / src / univ / winuniv.cpp
index afc1a6efbd6132fdee5590eddb5be3df87b881d1..1fbcf71f9613f73c753797eb67f29b873f8cc02f 100644 (file)
@@ -284,10 +284,10 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
         AdjustForParentClientOrigin( pos.x, pos.y, 0 );
 
         // Adjust DC logical origin
-        wxCoord x,y;
-        dc.GetLogicalOrigin( &x, &y );
-        x += pos.x;
-        y += pos.y;
+        wxCoord org_x, org_y, x, y;
+        dc.GetLogicalOrigin( &org_x, &org_y );
+        x = org_x + pos.x;
+        y = org_y + pos.y;
         dc.SetLogicalOrigin( x, y );
 
         // Adjust draw rect
@@ -296,6 +296,9 @@ bool wxWindow::DoDrawBackground(wxDC& dc)
 
         // Let parent draw the background
         parent->EraseBackground( dc, rect );
+
+        // Restore DC logical origin
+        dc.SetLogicalOrigin( org_x, org_y );
     }
     else
     {