#ifndef WX_PRECOMP
#include "wx/dcclient.h"
+ #include "wx/dcmemory.h"
#include "wx/log.h"
#include "wx/region.h"
#endif
virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0,
wxDouble tx=0.0, wxDouble ty=0.0);
+ // gets the component valuess of the matrix
+ virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL,
+ wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const;
+
// makes this the inverse matrix
virtual void Invert();
m_matrix = CGAffineTransformMake(a,b,c,d,tx,ty);
}
+// gets the component valuess of the matrix
+void wxMacCoreGraphicsMatrixData::Get(wxDouble* a, wxDouble* b, wxDouble* c,
+ wxDouble* d, wxDouble* tx, wxDouble* ty) const
+{
+ if (a) *a = m_matrix.a;
+ if (b) *b = m_matrix.b;
+ if (c) *c = m_matrix.c;
+ if (d) *d = m_matrix.d;
+ if (tx) *tx= m_matrix.tx;
+ if (ty) *ty= m_matrix.ty;
+}
+
// makes this the inverse matrix
void wxMacCoreGraphicsMatrixData::Invert()
{
virtual void DrawPath( const wxGraphicsPath &path, int fillStyle = wxODDEVEN_RULE );
virtual bool ShouldOffset() const
- {
+ {
int penwidth = 0 ;
if ( !m_pen.IsNull() )
{
if ( CGContextSetBlendMode != NULL )
{
CGContextSetBlendMode( m_cgContext, kCGBlendModeNormal );
+ CGContextSetShouldAntialias( m_cgContext, true );
}
#endif
}
{
// change color to white
CGContextSetBlendMode( m_cgContext, kCGBlendModeExclusion );
+ CGContextSetShouldAntialias( m_cgContext, false );
retval = true;
}
#endif
*width = FixedToInt(textAfter - textBefore);
::ATSUDisposeTextLayout(atsuLayout);
+#if SIZEOF_WCHAR_T == 4
+ free( ubuf ) ;
+#endif
}
void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const
}
::ATSUDisposeTextLayout(atsuLayout);
+#if SIZEOF_WCHAR_T == 4
+ free( ubuf ) ;
+#endif
}
void * wxMacCoreGraphicsContext::GetNativeContext()
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxWindowDC& dc)
{
- return new wxMacCoreGraphicsContext(this,(CGContextRef)dc.GetWindow()->MacGetCGContextRef() );
+ wxMemoryDC* mdc = wxDynamicCast(&dc, wxMemoryDC);
+ if ( mdc )
+ {
+ return new wxMacCoreGraphicsContext(this,
+ (CGContextRef)mdc->GetGraphicsContext()->GetNativeContext());
+ }
+ else
+ {
+ return new wxMacCoreGraphicsContext(this,(CGContextRef)dc.GetWindow()->MacGetCGContextRef() );
+ }
}
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( void * context )