mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
[Desktop] Fix issue where the battlefield sometimes would not get repainted.
This commit is contained in:
@@ -334,6 +334,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
this.setPreferredSize(new Dimension(maxRowWidth - this.cardSpacingX, y - this.cardSpacingY));
|
||||
this.revalidate();
|
||||
positionAllCards(lastTemplate);
|
||||
repaint();
|
||||
}
|
||||
|
||||
// Position all card panels
|
||||
@@ -641,7 +642,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
|
||||
boolean needLayoutRefresh = !newPanels.isEmpty();
|
||||
for (final CardView card : modelCopy) {
|
||||
if (updateCard(card, true)) {
|
||||
if (doUpdateCard(card, true)) {
|
||||
needLayoutRefresh = true;
|
||||
}
|
||||
}
|
||||
@@ -661,6 +662,13 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
}
|
||||
|
||||
public boolean updateCard(final CardView card, boolean fromRefresh) {
|
||||
FThreads.assertExecutedByEdt(true);
|
||||
boolean result = doUpdateCard(card, fromRefresh);
|
||||
repaint();
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean doUpdateCard(final CardView card, boolean fromRefresh) {
|
||||
final CardPanel toPanel = getCardPanel(card.getId());
|
||||
if (toPanel == null) { return false; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user