* Card panel - Fixed a bug in deck Editor that card images were not displayed, if the number of displayed cards exactly equal to the limit of cards (300) that are shown with images. Raised the liit from 300 to 350.

This commit is contained in:
LevelX2 2014-03-27 08:44:56 +01:00
parent 16bc70576a
commit 3e22c50ed6

View file

@ -67,14 +67,14 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
protected CardEventSource cardEventSource = new CardEventSource();
protected BigCard bigCard;
protected UUID gameId;
private Map<UUID, MageCard> cards = new HashMap<UUID, MageCard>();
private final Map<UUID, MageCard> cards = new HashMap<>();
private Dimension cardDimension;
/**
* Max amount of cards in card grid for which card images will be drawn.
* Done so to solve issue with memory for big piles of cards.
*/
public static final int MAX_IMAGES = 300;
public static final int MAX_IMAGES = 350;
public CardGrid() {
initComponents();
@ -97,7 +97,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
@Override
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId, boolean merge) {
boolean drawImage = showCards.size() < MAX_IMAGES;
boolean drawImage = showCards.size() <= MAX_IMAGES;
this.bigCard = bigCard;
this.gameId = gameId;
if (merge) {