diff --git a/docs/changes.txt b/docs/changes.txt index 1f724b4af9..d229c752cb 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -178,6 +178,7 @@ wxGTK: - Fixed size problem in wxTaskBarIcon - Fixed scrolling problem of wxStaticBox (and possibly other control) - Fixed wxFileDataObject for DnD in UTF8 locales with non-ASCII characters +- Fixed off by 1 bug in wxDC::GradientFillLinear() (Tim Kosse) wxMac: diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 9f875dd04d..5785668250 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -734,11 +734,11 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect, else nB = nB1 + (nB2-nB1)*(w-x)/w; - wxColour colour(nR,nG,nB); + wxColour colour(nR,nG,nB); SetPen(wxPen(colour, 1, wxSOLID)); SetBrush(wxBrush(colour)); if(nDirection == wxEAST) - DrawRectangle(rect.GetRight()-x-xDelta, rect.GetTop(), + DrawRectangle(rect.GetRight()-x-xDelta+1, rect.GetTop(), xDelta, rect.GetHeight()); else //nDirection == wxWEST DrawRectangle(rect.GetLeft()+x, rect.GetTop(), @@ -771,14 +771,14 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect, else nB = nB1 + (nB2-nB1)*(w-y)/w; - wxColour colour(nR,nG,nB); + 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); else //nDirection == wxSOUTH - DrawRectangle(rect.GetLeft(), rect.GetBottom()-y-yDelta, + DrawRectangle(rect.GetLeft(), rect.GetBottom()-y-yDelta+1, rect.GetWidth(), yDelta); } }