From 30184d9f4a83f6e515fa32d8da883d49e5ec891c Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 03:17:30 +0000 Subject: [PATCH] Fix elliptic arc drawing for complete circle in wxQT, thanks @seandepagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/qt/dc.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index a60a255ba1..246a5b38cd 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -498,8 +498,17 @@ void wxQtDCImpl::DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, y += penWidth / 2; w -= penWidth; h -= penWidth; - - m_qtPainter->drawPie( x, y, w, h, (int)( sa * 16 ), (int)( ( ea - sa ) * 16 ) ); + + double spanAngle = sa - ea; + if (spanAngle < -180) + spanAngle += 360; + if (spanAngle > 180) + spanAngle -= 360; + + if ( spanAngle == 0 ) + m_qtPainter->drawEllipse( x, y, w, h ); + else + m_qtPainter->drawPie( x, y, w, h, (int)( sa * 16 ), (int)( ( ea - sa ) * 16 ) ); } void wxQtDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)