From 1dab6da91b702ad41b249ecaf826a628bad05fce Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Tue, 14 Nov 2006 14:51:08 +0000 Subject: [PATCH] another GradientFillLinear fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dcbase.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 4264c85ae1..1475923953 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -733,12 +733,14 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect, else nB = nB1 + (nB2-nB1)*(w-x)/w; - SetPen(wxPen(wxColour(nR, nG, nB), 1, wxSOLID)); + wxColour colour(nR,nG,nB); + SetPen(wxPen(colour, 1, wxSOLID)); + SetBrush(wxBrush(colour)); if(nDirection == wxEAST) - DrawRectangle(rect.GetLeft()+x, rect.GetTop(), + DrawRectangle(rect.GetRight()-x-xDelta, rect.GetTop(), xDelta, rect.GetHeight()); else //nDirection == wxWEST - DrawRectangle(rect.GetRight()-x-xDelta, rect.GetTop(), + DrawRectangle(rect.GetLeft()+x, rect.GetTop(), xDelta, rect.GetHeight()); } } @@ -768,7 +770,9 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect, else nB = nB1 + (nB2-nB1)*(w-y)/w; - SetPen(wxPen(wxColour(nR, nG, nB), 1, wxSOLID)); + wxColour colour(nR,nG,nB); + SetPen(wxPen(colour, 1, wxSOLID)); + SetBrush(wxBrush(colour)); if(nDirection == wxNORTH) DrawRectangle(rect.GetLeft(), rect.GetTop()+y, rect.GetWidth(), yDelta);