]> git.saurik.com Git - wxWidgets.git/commitdiff
reverting part of r58797, otherwise wxClientDC get no graphics context at all
authorStefan Csomor <csomor@advancedconcepts.ch>
Thu, 24 Feb 2011 14:56:40 +0000 (14:56 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Thu, 24 Feb 2011 14:56:40 +0000 (14:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/graphics.cpp

index c5d4b5b90005336fc755cfabcd5cc36c16b47e36..4fc5c9f572f2006d924afe38f1a03a9c4e1324ce 100644 (file)
@@ -2756,8 +2756,9 @@ wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxWindowDC&
         if (win_impl->GetWindow())
             cgctx =  (CGContextRef)(win_impl->GetWindow()->MacGetCGContextRef());
 
-        if (cgctx != 0)
-            return new wxMacCoreGraphicsContext( this, cgctx, (wxDouble) w, (wxDouble) h );
+        // having a cgctx being NULL is fine (will be created on demand)
+        // this is the case for all wxWindowDCs except wxPaintDC
+        return new wxMacCoreGraphicsContext( this, cgctx, (wxDouble) w, (wxDouble) h );
     }
     return NULL;
 }