X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1adc25737bf5c001a2218fd6d8281262a811ace..21bd196564d8483879a57c40ec1eea64114f9bd4:/src/cocoa/dcmemory.mm diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 1c79b3ad67..0f2f04c365 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -20,6 +20,8 @@ #import #import #import +#import +#import //----------------------------------------------------------------------------- // wxMemoryDC @@ -51,8 +53,10 @@ bool wxMemoryDC::CocoaLockFocus() { [m_cocoaNSImage lockFocus]; sm_cocoaDCStack.Insert(this); - m_cocoaFlipped = [m_cocoaNSImage isFlipped]; - m_cocoaHeight = [m_cocoaNSImage size].height; + NSAffineTransform *newTransform = CocoaGetWxToBoundsTransform([m_cocoaNSImage isFlipped], [m_cocoaNSImage size].height); + [newTransform retain]; + [m_cocoaWxToBoundsTransform release]; + m_cocoaWxToBoundsTransform = newTransform; CocoaApplyTransformations(); return true; } @@ -150,3 +154,16 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, return false; } +bool wxMemoryDC::CocoaGetBounds(void *rectData) +{ + if(!rectData) + return false; + if(!m_cocoaNSImage) + return false; + NSRect *pRect = (NSRect*)rectData; + pRect->origin.x = 0.0; + pRect->origin.y = 0.0; + pRect->size = [m_cocoaNSImage size]; + return true; +} +