@@ -2633,8 +2633,8 @@ long CMiniWindow::Gradient(long Left, long Top, long Right, long Bottom,
2633
2633
vert [0 ] .Alpha = 0 ;
2634
2634
2635
2635
// second vertex
2636
- vert [1 ] .x = Right;
2637
- vert [1 ] .y = Bottom;
2636
+ vert [1 ] .x = FixRight ( Right) ;
2637
+ vert [1 ] .y = FixBottom ( Bottom) ;
2638
2638
vert [1 ] .Red = GetRValue (EndColour) << 8 ;
2639
2639
vert [1 ] .Green = GetGValue (EndColour) << 8 ;
2640
2640
vert [1 ] .Blue = GetBValue (EndColour) << 8 ;
@@ -2680,9 +2680,10 @@ long CMiniWindow::Gradient(long Left, long Top, long Right, long Bottom,
2680
2680
case 1 : // horizontal (left to right)
2681
2681
2682
2682
{
2683
- for (long x = Left; x < Right; x++)
2683
+ long iRight = FixRight (Right);
2684
+ for (long x = Left; x < iRight; x++)
2684
2685
{
2685
- dc.FillSolidRect ( x, Top, 1 , Bottom - Top , RGB (rval, gval, bval) );
2686
+ dc.FillSolidRect ( x, Top, 1 , iHeight , RGB (rval, gval, bval) );
2686
2687
rval += rinc;
2687
2688
gval += ginc;
2688
2689
bval += binc;
@@ -2694,9 +2695,10 @@ long CMiniWindow::Gradient(long Left, long Top, long Right, long Bottom,
2694
2695
case 2 : // vertical (top to bottom)
2695
2696
2696
2697
{
2697
- for (long y = Top; y < Bottom; y++)
2698
+ long iBottom = FixBottom (Bottom);
2699
+ for (long y = Top; y < iBottom; y++)
2698
2700
{
2699
- dc.FillSolidRect ( Left, y, Right - Left , 1 , RGB (rval, gval, bval) );
2701
+ dc.FillSolidRect ( Left, y, iWidth , 1 , RGB (rval, gval, bval) );
2700
2702
rval += rinc;
2701
2703
gval += ginc;
2702
2704
bval += binc;
0 commit comments