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
This commit is contained in:
Vadim Zeitlin
2007-09-09 19:36:50 +00:00
parent 721fbc2f1c
commit 1d497cf7db
2 changed files with 5 additions and 4 deletions

View File

@@ -178,6 +178,7 @@ wxGTK:
- Fixed size problem in wxTaskBarIcon - Fixed size problem in wxTaskBarIcon
- Fixed scrolling problem of wxStaticBox (and possibly other control) - Fixed scrolling problem of wxStaticBox (and possibly other control)
- Fixed wxFileDataObject for DnD in UTF8 locales with non-ASCII characters - Fixed wxFileDataObject for DnD in UTF8 locales with non-ASCII characters
- Fixed off by 1 bug in wxDC::GradientFillLinear() (Tim Kosse)
wxMac: wxMac:

View File

@@ -734,11 +734,11 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect,
else else
nB = nB1 + (nB2-nB1)*(w-x)/w; nB = nB1 + (nB2-nB1)*(w-x)/w;
wxColour colour(nR,nG,nB); wxColour colour(nR,nG,nB);
SetPen(wxPen(colour, 1, wxSOLID)); SetPen(wxPen(colour, 1, wxSOLID));
SetBrush(wxBrush(colour)); SetBrush(wxBrush(colour));
if(nDirection == wxEAST) if(nDirection == wxEAST)
DrawRectangle(rect.GetRight()-x-xDelta, rect.GetTop(), DrawRectangle(rect.GetRight()-x-xDelta+1, rect.GetTop(),
xDelta, rect.GetHeight()); xDelta, rect.GetHeight());
else //nDirection == wxWEST else //nDirection == wxWEST
DrawRectangle(rect.GetLeft()+x, rect.GetTop(), DrawRectangle(rect.GetLeft()+x, rect.GetTop(),
@@ -771,14 +771,14 @@ void wxDCBase::DoGradientFillLinear(const wxRect& rect,
else else
nB = nB1 + (nB2-nB1)*(w-y)/w; nB = nB1 + (nB2-nB1)*(w-y)/w;
wxColour colour(nR,nG,nB); wxColour colour(nR,nG,nB);
SetPen(wxPen(colour, 1, wxSOLID)); SetPen(wxPen(colour, 1, wxSOLID));
SetBrush(wxBrush(colour)); SetBrush(wxBrush(colour));
if(nDirection == wxNORTH) if(nDirection == wxNORTH)
DrawRectangle(rect.GetLeft(), rect.GetTop()+y, DrawRectangle(rect.GetLeft(), rect.GetTop()+y,
rect.GetWidth(), yDelta); rect.GetWidth(), yDelta);
else //nDirection == wxSOUTH else //nDirection == wxSOUTH
DrawRectangle(rect.GetLeft(), rect.GetBottom()-y-yDelta, DrawRectangle(rect.GetLeft(), rect.GetBottom()-y-yDelta+1,
rect.GetWidth(), yDelta); rect.GetWidth(), yDelta);
} }
} }