better color sorting, colorless decks icon is properly centered

This commit is contained in:
Maxmtg
2014-01-13 19:30:07 +00:00
parent b8ea837204
commit 870ffe3437
2 changed files with 12 additions and 6 deletions

View File

@@ -56,8 +56,8 @@ public class ColorSetRenderer extends ItemCellRenderer {
final int cntGlyphs = cs.countColors();
final int offsetIfNoSpace = cntGlyphs > 1 ? (cellWidth - padding0 - elemtWidth) / (cntGlyphs - 1) : elemtWidth + elemtGap;
final int dx = Math.min(elemtWidth + elemtGap, offsetIfNoSpace);
int takenUpWidth = cntGlyphs * ( elemtWidth + elemtGap ) - elemtGap;
int takenUpWidth = Math.max(1, cntGlyphs) * ( elemtWidth + elemtGap ) - elemtGap;
if( takenUpWidth < cellWidth - padding0)
x += (cellWidth - padding0 - takenUpWidth) / 2;