]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/dcmemory.mm
Initial move from C to C++. The functionality of the code should not have
[wxWidgets.git] / src / cocoa / dcmemory.mm
index 10b01be3b3d9b4d160816a5c48a791d95340a77c..3bdb6dd67ea36c81833a1eb7c460c3e61620c1d8 100644 (file)
@@ -9,8 +9,11 @@
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#include "wx/dcmemory.h"
-#include "wx/log.h"
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+    #include "wx/log.h"
+    #include "wx/dcmemory.h"
+#endif //WX_PRECOMP
 
 #import <AppKit/NSImage.h>
 #import <AppKit/NSAffineTransform.h>
 
 #import <AppKit/NSImage.h>
 #import <AppKit/NSAffineTransform.h>
@@ -90,10 +93,12 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
                 initWithSize:NSMakeSize(m_selectedBitmap.GetWidth(),
                     m_selectedBitmap.GetHeight())];
         [nsimage addRepresentation: const_cast<wxBitmap&>(m_selectedBitmap).GetNSBitmapImageRep()];
                 initWithSize:NSMakeSize(m_selectedBitmap.GetWidth(),
                     m_selectedBitmap.GetHeight())];
         [nsimage addRepresentation: const_cast<wxBitmap&>(m_selectedBitmap).GetNSBitmapImageRep()];
+        [m_cocoaNSImage lockFocus];
         [nsimage drawAtPoint: NSMakePoint(0,0)
             fromRect: NSMakeRect(0.0,0.0,m_selectedBitmap.GetWidth(),m_selectedBitmap.GetHeight())
             operation: NSCompositeCopy
             fraction: 1.0];
         [nsimage drawAtPoint: NSMakePoint(0,0)
             fromRect: NSMakeRect(0.0,0.0,m_selectedBitmap.GetWidth(),m_selectedBitmap.GetHeight())
             operation: NSCompositeCopy
             fraction: 1.0];
+        [m_cocoaNSImage unlockFocus];
         
         [nsimage release];
     }
         
         [nsimage release];
     }