diff --git a/docs/changes.txt b/docs/changes.txt index d35373ea98..72059b89cd 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -122,6 +122,7 @@ wxMSW: - Revert to using equally-sized buttons in wxToolBar by default. - Restore dispatching wxThreadEvent while resizing the window broken in 3.1.0. - Fix wxGraphicsMatrix::TransformDistance for Direct2D renderer. +- Fix wxDC::Clear() for rotated DC. wxOSX: diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 186db72bb0..193067414c 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -722,6 +722,10 @@ void wxMSWDCImpl::Clear() HBRUSH brush = ::CreateSolidBrush(colour); RECT rect; ::GetClipBox(GetHdc(), &rect); + // Inflate the box by 1 unit in each direction + // to compensate rounding errors if DC is the subject + // of complex transformation (is e.g. rotated). + ::InflateRect(&rect, 1, 1); ::FillRect(GetHdc(), &rect, brush); ::DeleteObject(brush);