From 1d497cf7db4dd69a9e47ae43a8e545812ffd02f0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Sep 2007 19:36:50 +0000 Subject: [PATCH] fixed off by 1 bug in wxDC::GradientFillLinear() (patch 1788549) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/common/dcbase.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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); } }