From: Paul Cornett Date: Thu, 2 Aug 2012 16:25:14 +0000 (+0000) Subject: Fix wxGCDC::Clear() for Cairo, and possibly MSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0c4438d26e184e95a465b48794086df19a80b55c Fix wxGCDC::Clear() for Cairo, and possibly MSW. Maximum positive coordinate Cairo can handle is 2^23 - 1. Also convert coordinates to logical so it works right with modified origin or scale. See #14529 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 5f79c36eb7..7cadde1395 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -38,8 +38,6 @@ #endif #endif -#include // for INT_MAX - //----------------------------------------------------------------------------- // constants //----------------------------------------------------------------------------- @@ -1060,7 +1058,10 @@ void wxGCDCImpl::Clear(void) m_graphicContext->SetPen( p ); wxCompositionMode formerMode = m_graphicContext->GetCompositionMode(); m_graphicContext->SetCompositionMode(wxCOMPOSITION_SOURCE); - DoDrawRectangle( 0, 0, INT_MAX , INT_MAX ); + // maximum positive coordinate Cairo can handle is 2^23 - 1 + DoDrawRectangle( + DeviceToLogicalX(0), DeviceToLogicalY(0), + DeviceToLogicalXRel(0x007fffff), DeviceToLogicalYRel(0x007fffff)); m_graphicContext->SetCompositionMode(formerMode); m_graphicContext->SetPen( m_pen ); m_graphicContext->SetBrush( m_brush );