This commit is contained in:
Oleg Agafonov 2019-03-28 17:09:23 +04:00
parent 771fac97ef
commit 01adbcf96f

View file

@ -70,6 +70,14 @@ public class CardArea extends JPanel implements MouseListener {
this.verticalCardOffset = verticalCardOffset;
}
private void fixDialogSize() {
// fix panel size (must include scrolls)
Dimension newSize = new Dimension(cardArea.getPreferredSize());
newSize.width += 20;
newSize.height += 20;
this.setPreferredSize(newSize);
}
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId) {
this.reloaded = true;
cardArea.removeAll();
@ -85,11 +93,7 @@ public class CardArea extends JPanel implements MouseListener {
this.revalidate();
this.repaint();
// fix panel size (must include scrolls)
Dimension newSize = new Dimension(cardArea.getPreferredSize());
newSize.width += 20;
newSize.height += 20;
this.setPreferredSize(newSize);
fixDialogSize();
}
public void loadCardsNarrow(CardsView showCards, BigCard bigCard, UUID gameId) {
@ -103,6 +107,8 @@ public class CardArea extends JPanel implements MouseListener {
this.revalidate();
this.repaint();
fixDialogSize();
}
private void loadCardsFew(CardsView showCards, BigCard bigCard, UUID gameId) {