Don't attempt to get CTM if CGContext is NULL

When wxMacCoreGraphicsContext is constructed with CGContext==NULL, initial
transformation matrix can be assumed as an identity matrix.
This commit is contained in:
Artur Wieczorek 2017-07-09 14:43:22 +02:00
parent 796ffb3671
commit 3105134548

View File

@ -1467,7 +1467,7 @@ wxMacCoreGraphicsContext::wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer
SetNativeContext(cgcontext);
m_width = width;
m_height = height;
m_initTransform = CGContextGetCTM(m_cgContext);
m_initTransform = m_cgContext ? CGContextGetCTM(m_cgContext) : CGAffineTransformIdentity;
}
wxMacCoreGraphicsContext::wxMacCoreGraphicsContext( wxGraphicsRenderer* renderer, wxWindow* window ): wxGraphicsContext(renderer)