X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15cae9eb9e277bcc3c63b3c5c20defe981660c79..15126fa8c239f279ca2501c0b52afcc1c3e5d4cc:/src/mac/dc.cpp diff --git a/src/mac/dc.cpp b/src/mac/dc.cpp index 44e19f24c6..d9b5abecbd 100644 --- a/src/mac/dc.cpp +++ b/src/mac/dc.cpp @@ -754,6 +754,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) void wxDC::DoCrossHair( wxCoord x, wxCoord y ) { wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") ); + wxMacPortSetter helper(this) ; if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -815,6 +816,7 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord xc, wxCoord yc ) { wxCHECK_RET(Ok(), wxT("wxDC::DoDrawArc Invalid DC")); + wxMacPortSetter helper(this) ; wxCoord xx1 = XLOG2DEVMAC(x1); wxCoord yy1 = YLOG2DEVMAC(y1); @@ -868,6 +870,7 @@ void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea ) { wxCHECK_RET(Ok(), wxT("wxDC::DoDrawEllepticArc Invalid DC")); + wxMacPortSetter helper(this) ; Rect r; double angle = sa - ea; // Order important Mac in opposite direction to wx @@ -955,8 +958,8 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[], PolyHandle polygon = OpenPoly(); - x1 = XLOG2DEVMAC(points[0].x + xoffset); - y1 = YLOG2DEVMAC(points[0].y + yoffset); + x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset); + y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset); ::MoveTo(x1,y1); for (int i = 1; i < n; i++) @@ -1436,7 +1439,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, if ( 0 ) { m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, m_scaleY * font->m_macFontSize); + SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * font->m_macFontSize)); m_macAliasWasEnabled = true ; } @@ -1464,9 +1467,10 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, &chars , (ATSUStyle*) &m_macATSUIStyle , &atsuLayout ) ; wxASSERT_MSG( status == noErr , "couldn't create the layout of the rotated text" ); - if ( abs(angle) > 0 ) + int iAngle = int( angle ); + if ( abs(iAngle) > 0 ) { - Fixed atsuAngle = IntToFixed( angle ) ; + Fixed atsuAngle = IntToFixed( iAngle ) ; ByteCount angleSize = sizeof(Fixed) ; ATSUAttributeTag rotationTag = kATSULineRotationTag ; ATSUAttributeValuePtr angleValue = &atsuAngle ; @@ -1646,7 +1650,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he macText = wxMacMakeMacStringFromPC( string ) ; text = macText ; length = macText.Length() ; - } + } else { text = string ; @@ -1862,7 +1866,7 @@ void wxDC::MacInstallFont() const OSStatus status = noErr ; - Fixed atsuSize = IntToFixed(m_scaleY * font->m_macFontSize) ; + Fixed atsuSize = IntToFixed( int(m_scaleY * font->m_macFontSize) ) ; Style qdStyle = font->m_macFontStyle ; ATSUFontID atsuFont = font->m_macATSUFontID ; @@ -1931,13 +1935,13 @@ void wxDC::MacInstallFont() const Pattern gHatchPatterns[] = { - { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } , - { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } , - { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } , - { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } , - { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } , - { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } , - { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } , + { { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } }, + { { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } }, + { { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } }, + { { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } }, + { { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } }, + { { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } }, + { { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } } ; static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern) @@ -2037,8 +2041,11 @@ void wxDC::MacInstallPen() const case wxUSER_DASH : { wxDash* dash ; - int number = m_pen.GetDashes(&dash) ; + m_pen.GetDashes(&dash) ; + // right now we don't allocate larger pixmaps + // int number = + m_pen.GetDashes(&dash) ; for ( int i = 0 ; i < 8 ; ++i ) { pat.pat[i] = dash[0] ;