Skip to content

Commit 6d15089

Browse files
committed
Fixed bug in WindowGradient
1 parent 053e1be commit 6d15089

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

miniwindow.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,8 +2633,8 @@ long CMiniWindow::Gradient(long Left, long Top, long Right, long Bottom,
26332633
vert [0] .Alpha = 0;
26342634

26352635
// second vertex
2636-
vert [1] .x = Right;
2637-
vert [1] .y = Bottom;
2636+
vert [1] .x = FixRight (Right);
2637+
vert [1] .y = FixBottom (Bottom);
26382638
vert [1] .Red = GetRValue (EndColour) << 8;
26392639
vert [1] .Green = GetGValue (EndColour) << 8;
26402640
vert [1] .Blue = GetBValue (EndColour) << 8;
@@ -2680,9 +2680,10 @@ long CMiniWindow::Gradient(long Left, long Top, long Right, long Bottom,
26802680
case 1 : // horizontal (left to right)
26812681

26822682
{
2683-
for (long x = Left; x < Right; x++)
2683+
long iRight = FixRight (Right);
2684+
for (long x = Left; x < iRight; x++)
26842685
{
2685-
dc.FillSolidRect( x, Top, 1, Bottom - Top, RGB (rval, gval, bval) );
2686+
dc.FillSolidRect( x, Top, 1, iHeight, RGB (rval, gval, bval) );
26862687
rval += rinc;
26872688
gval += ginc;
26882689
bval += binc;
@@ -2694,9 +2695,10 @@ long CMiniWindow::Gradient(long Left, long Top, long Right, long Bottom,
26942695
case 2 : // vertical (top to bottom)
26952696

26962697
{
2697-
for (long y = Top; y < Bottom; y++)
2698+
long iBottom = FixBottom (Bottom);
2699+
for (long y = Top; y < iBottom; y++)
26982700
{
2699-
dc.FillSolidRect( Left, y, Right - Left, 1, RGB (rval, gval, bval) );
2701+
dc.FillSolidRect( Left, y, iWidth, 1, RGB (rval, gval, bval) );
27002702
rval += rinc;
27012703
gval += ginc;
27022704
bval += binc;

0 commit comments

Comments
 (0)