X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3b81044ee30ead362ba6e1bf95af13248afe41c..69659fd770f615210efac4b4fa741b3ad6223616:/src/common/dcgraph.cpp?ds=sidebyside diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 40ff9d38d9..420e9039bb 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -501,20 +501,15 @@ void wxGCDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h, if ( !m_logicalFunctionSupported ) return; - bool fill = m_brush.GetStyle() != wxTRANSPARENT; - wxGraphicsPath path = m_graphicContext->CreatePath(); m_graphicContext->PushState(); - m_graphicContext->Translate(x+w/2,y+h/2); + m_graphicContext->Translate(x+w/2.0,y+h/2.0); wxDouble factor = ((wxDouble) w) / h; m_graphicContext->Scale( factor , 1.0); - if ( fill && (sa!=ea) ) - path.MoveToPoint(0,0); + // since these angles (ea,sa) are measured counter-clockwise, we invert them to // get clockwise angles - path.AddArc( 0, 0, h/2 , DegToRad(-sa) , DegToRad(-ea), sa > ea ); - if ( fill && (sa!=ea) ) - path.AddLineToPoint(0,0); + path.AddArc( 0, 0, h/2.0 , DegToRad(-sa) , DegToRad(-ea), sa > ea ); m_graphicContext->DrawPath( path ); m_graphicContext->PopState(); } @@ -698,6 +693,13 @@ void wxGCDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, if (w == 0 || h == 0) return; + if ( m_graphicContext->ShouldOffset() ) + { + // if we are offsetting the entire rectangle is moved 0.5, so the + // border line gets off by 1 + w -= 1; + h -= 1; + } m_graphicContext->DrawRoundedRectangle( x,y,w,h,radius); } @@ -708,6 +710,13 @@ void wxGCDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) if ( !m_logicalFunctionSupported ) return; + if ( m_graphicContext->ShouldOffset() ) + { + // if we are offsetting the entire rectangle is moved 0.5, so the + // border line gets off by 1 + w -= 1; + h -= 1; + } m_graphicContext->DrawEllipse(x,y,w,h); } @@ -821,7 +830,7 @@ bool wxGCDC::CanGetTextExtent() const void wxGCDC::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *height, wxCoord *descent, wxCoord *externalLeading , - wxFont *theFont ) const + const wxFont *theFont ) const { wxCHECK_RET( Ok(), wxT("wxGCDC(cg)::DoGetTextExtent - invalid DC") );