git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41937
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxMacCGContext::StrokePath( const wxGraphicPath *p )
{
const wxMacCGPath* path = dynamic_cast< const wxMacCGPath*>( p ) ;
void wxMacCGContext::StrokePath( const wxGraphicPath *p )
{
const wxMacCGPath* path = dynamic_cast< const wxMacCGPath*>( p ) ;
+
+ int width = m_pen.GetWidth();
+ if ( width == 0 )
+ width = 1 ;
+ if ( m_pen.GetStyle() == wxTRANSPARENT )
+ width = 0 ;
+
+ bool offset = ( width % 2 ) == 1 ;
+
+ if ( offset )
+ CGContextTranslateCTM( m_cgContext, 0.5, 0.5 );
+
CGContextAddPath( m_cgContext , path->GetPath() ) ;
CGContextStrokePath( m_cgContext ) ;
CGContextAddPath( m_cgContext , path->GetPath() ) ;
CGContextStrokePath( m_cgContext ) ;
+
+ if ( offset )
+ CGContextTranslateCTM( m_cgContext, -0.5, -0.5 );
}
void wxMacCGContext::DrawPath( const wxGraphicPath *p , int fillStyle )
}
void wxMacCGContext::DrawPath( const wxGraphicPath *p , int fillStyle )
mode = kCGPathEOFillStroke ;
}
mode = kCGPathEOFillStroke ;
}
+ int width = m_pen.GetWidth();
+ if ( width == 0 )
+ width = 1 ;
+ if ( m_pen.GetStyle() == wxTRANSPARENT )
+ width = 0 ;
+
+ bool offset = ( width % 2 ) == 1 ;
+
+ if ( offset )
+ CGContextTranslateCTM( m_cgContext, 0.5, 0.5 );
+
CGContextAddPath( m_cgContext , path->GetPath() ) ;
CGContextDrawPath( m_cgContext , mode ) ;
CGContextAddPath( m_cgContext , path->GetPath() ) ;
CGContextDrawPath( m_cgContext , mode ) ;
+
+ if ( offset )
+ CGContextTranslateCTM( m_cgContext, -0.5, -0.5 );
}
void wxMacCGContext::FillPath( const wxGraphicPath *p , const wxColor &fillColor , int fillStyle )
}
void wxMacCGContext::FillPath( const wxGraphicPath *p , const wxColor &fillColor , int fillStyle )
{
if ( m_pen == pen )
return ;
{
if ( m_pen == pen )
return ;
m_pen = pen;
if ( m_graphicContext )
{
m_pen = pen;
if ( m_graphicContext )
{