more cleanup - added comment regarding possible stipple brush problem
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -779,8 +779,10 @@ void AddRoundedRectToPath(CGContextRef c, CGRect rect, float ovalWidth,
|
|||||||
CGContextSaveGState(c);
|
CGContextSaveGState(c);
|
||||||
CGContextTranslateCTM(c, CGRectGetMinX(rect), CGRectGetMinY(rect));
|
CGContextTranslateCTM(c, CGRectGetMinX(rect), CGRectGetMinY(rect));
|
||||||
CGContextScaleCTM(c, ovalWidth, ovalHeight);
|
CGContextScaleCTM(c, ovalWidth, ovalHeight);
|
||||||
|
|
||||||
fw = CGRectGetWidth(rect) / ovalWidth;
|
fw = CGRectGetWidth(rect) / ovalWidth;
|
||||||
fh = CGRectGetHeight(rect) / ovalHeight;
|
fh = CGRectGetHeight(rect) / ovalHeight;
|
||||||
|
|
||||||
CGContextMoveToPoint(c, fw, fh / 2);
|
CGContextMoveToPoint(c, fw, fh / 2);
|
||||||
CGContextAddArcToPoint(c, fw, fh, fw / 2, fh, 1);
|
CGContextAddArcToPoint(c, fw, fh, fw / 2, fh, 1);
|
||||||
CGContextAddArcToPoint(c, 0, fh, 0, fh / 2, 1);
|
CGContextAddArcToPoint(c, 0, fh, 0, fh / 2, 1);
|
||||||
@@ -2053,10 +2055,10 @@ void wxDC::Clear(void)
|
|||||||
drawInfo.state = kThemeStateActive ;
|
drawInfo.state = kThemeStateActive ;
|
||||||
drawInfo.kind = m_backgroundBrush.MacGetThemeBackground( NULL ) ;
|
drawInfo.kind = m_backgroundBrush.MacGetThemeBackground( NULL ) ;
|
||||||
if ( drawInfo.kind == kThemeBackgroundMetal )
|
if ( drawInfo.kind == kThemeBackgroundMetal )
|
||||||
HIThemeDrawBackground( &rect , &drawInfo, cg ,
|
{
|
||||||
kHIThemeOrientationNormal) ;
|
HIThemeDrawBackground( &rect, &drawInfo, cg, kHIThemeOrientationNormal ) ;
|
||||||
HIThemeApplyBackground( &rect , &drawInfo, cg ,
|
HIThemeApplyBackground( &rect, &drawInfo, cg, kHIThemeOrientationNormal ) ;
|
||||||
kHIThemeOrientationNormal) ;
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -2064,6 +2066,9 @@ void wxDC::Clear(void)
|
|||||||
|
|
||||||
case kwxMacBrushColour :
|
case kwxMacBrushColour :
|
||||||
{
|
{
|
||||||
|
// FIXME: doesn't correctly render stippled brushes !!
|
||||||
|
// FIXME: should this be replaced by ::SetBrush() ??
|
||||||
|
|
||||||
RGBColor col = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()) ;
|
RGBColor col = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()) ;
|
||||||
CGContextSetRGBFillColor( cg , col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 ) ;
|
CGContextSetRGBFillColor( cg , col.red / 65536.0 , col.green / 65536.0 , col.blue / 65536.0 , 1.0 ) ;
|
||||||
CGContextFillRect(cg, rect);
|
CGContextFillRect(cg, rect);
|
||||||
@@ -2093,10 +2098,11 @@ void wxDC::MacInstallFont() const
|
|||||||
|
|
||||||
if ( m_font.Ok() )
|
if ( m_font.Ok() )
|
||||||
{
|
{
|
||||||
OSStatus status = noErr ;
|
OSStatus status ;
|
||||||
|
|
||||||
status = ATSUCreateAndCopyStyle( (ATSUStyle) m_font.MacGetATSUStyle() , (ATSUStyle*) &m_macATSUIStyle ) ;
|
status = ATSUCreateAndCopyStyle( (ATSUStyle) m_font.MacGetATSUStyle() , (ATSUStyle*) &m_macATSUIStyle ) ;
|
||||||
|
|
||||||
wxASSERT_MSG( status == noErr, wxT("couldn't set create ATSU style") ) ;
|
wxASSERT_MSG( status == noErr, wxT("couldn't create ATSU style") ) ;
|
||||||
|
|
||||||
Fixed atsuSize = IntToFixed( int(m_scaleY * m_font.MacGetFontSize()) ) ;
|
Fixed atsuSize = IntToFixed( int(m_scaleY * m_font.MacGetFontSize()) ) ;
|
||||||
RGBColor atsuColor = MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ;
|
RGBColor atsuColor = MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ;
|
||||||
@@ -2110,19 +2116,17 @@ void wxDC::MacInstallFont() const
|
|||||||
sizeof( Fixed ) ,
|
sizeof( Fixed ) ,
|
||||||
sizeof( RGBColor ) ,
|
sizeof( RGBColor ) ,
|
||||||
} ;
|
} ;
|
||||||
// Boolean kTrue = true ;
|
|
||||||
// Boolean kFalse = false ;
|
|
||||||
// ATSUVerticalCharacterType kHorizontal = kATSUStronglyHorizontal;
|
|
||||||
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
|
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
|
||||||
{
|
{
|
||||||
&atsuSize ,
|
&atsuSize ,
|
||||||
&atsuColor ,
|
&atsuColor ,
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) ,
|
status = ::ATSUSetAttributes(
|
||||||
|
(ATSUStyle)m_macATSUIStyle, sizeof(atsuTags) / sizeof(ATSUAttributeTag) ,
|
||||||
atsuTags, atsuSizes, atsuValues);
|
atsuTags, atsuSizes, atsuValues);
|
||||||
|
|
||||||
wxASSERT_MSG( status == noErr , wxT("couldn't Modify ATSU style") ) ;
|
wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user