Skip to content

Commit

Permalink
main bg color was incorrect when block is mostly complete
Browse files Browse the repository at this point in the history
  • Loading branch information
TuxPaper committed Nov 4, 2023
1 parent 2a28629 commit 522ac89
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions uis/src/com/biglybt/ui/swt/views/piece/PieceMapView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,7 @@ else if (iNewWidth <= 0)
}

Color bg;
Color bgMain = null;
Colors colorsInstance = Colors.getInstance();
if ( newInfo.selectedRange ){
Color fc = blockColors[BLOCKCOLOR_SHOWFILE ];
Expand All @@ -1241,8 +1242,8 @@ else if (iNewWidth <= 0)
file_color = fc;
file_color_faded = colorsInstance.getLighterColor( fc, 75 );
}
bg = file_color_faded;

bgMain = bg = file_color_faded;

} else {
bg = canvasBG;
Expand Down Expand Up @@ -1282,8 +1283,12 @@ else if (iNewWidth <= 0)
gcImg.setBackground(bg);

gcImg.fillRectangle(iXPos, iYPos, newInfo.haveWidth, BLOCK_FILLSIZE);

if (newInfo.haveWidth * 2 > BLOCK_FILLSIZE) {
bgMain = bg;
}
}

bg = newInfo.needed ? blockColors[BLOCKCOLOR_NOHAVE] : canvasBG;

if (newInfo.availNum >= 0 && newInfo.availNum < maxAvailability) {
Expand All @@ -1295,11 +1300,14 @@ else if (iNewWidth <= 0)
}
}

Color bgMain = bg;
gcImg.setBackground(bg);
gcImg.fillRectangle(iXPos + newInfo.haveWidth, iYPos,
BLOCK_FILLSIZE - newInfo.haveWidth, BLOCK_FILLSIZE);

if (bgMain == null) {
bgMain = bg;
}

if (newInfo.showDown > 0) {
boolean isSmall = newInfo.showDown == SHOW_SMALL;
bg = blockColors[isSmall ? BLOCKCOLOR_NEXT : BLOCKCOLOR_TRANSFER];
Expand Down

0 comments on commit 522ac89

Please sign in to comment.