From c6d3b9c0b9d7f4837c675e1c0c6135d937f06b32 Mon Sep 17 00:00:00 2001 From: Jay Nabonne Date: Wed, 19 Dec 2018 09:05:29 +0000 Subject: [PATCH] Fix background colour used by DrawEllipse() in wxQt wxDC::DrawEllipse() used to use the text background for filling the ellipses drawn with transparent pen, for some reason. According to f9b28cd4325f42936d3122bfe7c847354bbbfee9 which changed this (this commit was part of df13791078f107edda80f50f1ab498ad936ff069 merge done with svn), this was done for compatibility with wxGTK, but wxGTK definitely doesn't do it now and apparently never did, so there must have been some mistake. Simply remove the extra code using the text background for consistency with this method behaviour in the other ports and also other methods behaviour in the same port. Closes https://github.com/wxWidgets/wxWidgets/pull/1087 --- src/qt/dc.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 737d1554d1..e5405276cd 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -577,29 +577,13 @@ void wxQtDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, void wxQtDCImpl::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { - QBrush savedBrush; - int penWidth = m_qtPainter->pen().width(); + const int penWidth = m_qtPainter->pen().width(); x += penWidth / 2; y += penWidth / 2; width -= penWidth; height -= penWidth; - if ( m_pen.IsNonTransparent() ) - { - // Save pen/brush - savedBrush = m_qtPainter->brush(); - // Fill with text background color ("no fill" like in wxGTK): - m_qtPainter->setBrush(QBrush(m_textBackgroundColour.GetQColor())); - } - - // Draw m_qtPainter->drawEllipse( x, y, width, height ); - - if ( m_pen.IsNonTransparent() ) - { - //Restore saved settings - m_qtPainter->setBrush(savedBrush); - } } void wxQtDCImpl::DoCrossHair(wxCoord x, wxCoord y)