1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-12 17:00:08 -09:00

Fixed last card in hand not displayed at full size.

This commit is contained in:
magenoxx 2010-12-05 06:56:45 +00:00
parent 63d1710cb7
commit 96ed56638d

View file

@ -59,6 +59,7 @@ public class Cards extends javax.swing.JPanel {
private Map<UUID, MageCard> cards = new LinkedHashMap<UUID, MageCard>();
private boolean dontDisplayTapped = false;
private static final int GAP_X = 5;
/** Creates new form Cards */
public Cards() {
@ -104,14 +105,16 @@ public class Cards extends javax.swing.JPanel {
cards.get(card.getId()).update(card);
}
cardArea.setPreferredSize(new Dimension(cards.size() * Config.dimensions.frameWidth, Config.dimensions.frameHeight));
if (changed) {
layoutCards(Config.dimensions);
}
cardArea.setPreferredSize(new Dimension(cards.size() * (Config.dimensions.frameWidth + GAP_X), Config.dimensions.frameHeight));
cardArea.revalidate();
cardArea.repaint();
this.revalidate();
this.repaint();
if (changed) {
layoutCards(Config.dimensions);
}
return changed;
}
@ -141,7 +144,7 @@ public class Cards extends javax.swing.JPanel {
for (MageCard card: cards.values()) {
card.setLocation(dx, 0);
card.setCardBounds(dx, 0, dimension.frameWidth, dimension.frameHeight);
dx += dimension.frameWidth + 5;
dx += dimension.frameWidth + GAP_X;
}
}
}