forked from External/mage
Fixed card grid dimension initialisation.
This commit is contained in:
parent
aa015b52e6
commit
ac757b6a88
2 changed files with 10 additions and 3 deletions
|
|
@ -78,6 +78,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
|
||||
public CardGrid() {
|
||||
initComponents();
|
||||
setGUISize();
|
||||
setOpaque(false);
|
||||
}
|
||||
|
||||
|
|
@ -90,6 +91,14 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
this.bigCard = null;
|
||||
}
|
||||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
cardDimension = GUISizeHelper.editorCardDimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCards(CardsView showCards, SortSetting sortSetting, BigCard bigCard, UUID gameId) {
|
||||
this.loadCards(showCards, sortSetting, bigCard, gameId, true);
|
||||
|
|
@ -125,9 +134,6 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
|||
}
|
||||
|
||||
private void addCard(CardView card, BigCard bigCard, UUID gameId, boolean drawImage) {
|
||||
if (cardDimension == null) {
|
||||
cardDimension = GUISizeHelper.editorCardDimension;
|
||||
}
|
||||
MageCard cardImg = Plugins.getInstance().getMageCard(card, bigCard, cardDimension, gameId, drawImage);
|
||||
cards.put(card.getId(), cardImg);
|
||||
cardImg.addMouseListener(this);
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
|
||||
public void changeGUISize() {
|
||||
setGUISize();
|
||||
cardGrid.changeGUISize();
|
||||
}
|
||||
|
||||
private void setGUISize() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue