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 df13791078
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
This commit is contained in:
committed by
Vadim Zeitlin
parent
c47c7de5ea
commit
c6d3b9c0b9
@@ -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)
|
||||
|
Reference in New Issue
Block a user