X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a4b50d2f1a81aa390ff70f4387bc776563cbab7..c829d62b6945c74edaf25210720129b8b749639d:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 5a72decc62..357f6b40f4 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -383,6 +383,24 @@ void wxDC::UpdateClipBox() m_clipY2 = (wxCoord) YDEV2LOG(rect.bottom); } +void +wxDC::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const +{ + // check if we should try to retrieve the clipping region possibly not set + // by our SetClippingRegion() but preset by Windows:this can only happen + // when we're associated with an existing HDC usign SetHDC(), see there + if ( m_clipping && !m_clipX1 && !m_clipX2 ) + { + wxDC *self = wxConstCast(this, wxDC); + self->UpdateClipBox(); + + if ( !m_clipX1 && !m_clipX2 ) + self->m_clipping = false; + } + + wxDCBase::DoGetClippingBox(x, y, w, h); +} + // common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion() void wxDC::SetClippingHrgn(WXHRGN hrgn) { @@ -465,7 +483,7 @@ void wxDC::DestroyClippingRegion() ::DeleteObject(rgn); } - m_clipping = false; + wxDCBase::DestroyClippingRegion(); } // ---------------------------------------------------------------------------