mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +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.setPreferredSize(new Dimension(maxRowWidth - this.cardSpacingX, y - this.cardSpacingY));
|
||||||
this.revalidate();
|
this.revalidate();
|
||||||
positionAllCards(lastTemplate);
|
positionAllCards(lastTemplate);
|
||||||
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Position all card panels
|
// Position all card panels
|
||||||
@@ -641,7 +642,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
|
|
||||||
boolean needLayoutRefresh = !newPanels.isEmpty();
|
boolean needLayoutRefresh = !newPanels.isEmpty();
|
||||||
for (final CardView card : modelCopy) {
|
for (final CardView card : modelCopy) {
|
||||||
if (updateCard(card, true)) {
|
if (doUpdateCard(card, true)) {
|
||||||
needLayoutRefresh = true;
|
needLayoutRefresh = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -661,6 +662,13 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateCard(final CardView card, boolean fromRefresh) {
|
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());
|
final CardPanel toPanel = getCardPanel(card.getId());
|
||||||
if (toPanel == null) { return false; }
|
if (toPanel == null) { return false; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user