X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b02d43401061e4c691811df24e849d57765dab7b..c8f80d27586a190927d491c618f48a4253246728:/src/common/dcgraph.cpp diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 2dc10c9a3d..6c4e534530 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -30,8 +30,8 @@ #include "wx/dcclient.h" -#ifdef __WXMAC__ -#include "wx/mac/private.h" +#ifdef __WXOSX__ + #include "ApplicationServices/ApplicationServices.h" #endif //----------------------------------------------------------------------------- @@ -197,7 +197,7 @@ void wxGCDCImpl::EndPage() void wxGCDCImpl::Flush() { -#ifdef __WXMAC__ +#ifdef __WXOSX__ CGContextFlush( (CGContextRef) m_graphicContext->GetNativeContext() ); #endif } @@ -952,8 +952,13 @@ void wxGCDCImpl::Clear(void) void wxGCDCImpl::DoGetSize(int *width, int *height) const { - *width = 10000; - *height = 10000; + wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoGetSize - invalid DC") ); + wxDouble w,h; + m_graphicContext->GetSize( &w, &h ); + if ( height ) + *height = (int) (h+0.5); + if ( width ) + *width = (int) (w+0.5); } void wxGCDCImpl::DoGradientFillLinear(const wxRect& rect,