mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
[cl.viewer] bigCard update issue fix.
This commit is contained in:
parent
5252255891
commit
5a0ca8025d
2 changed files with 12 additions and 5 deletions
|
|
@ -106,6 +106,10 @@ public class BigCard extends JComponent {
|
|||
return cardId;
|
||||
}
|
||||
|
||||
public void resetCardId() {
|
||||
this.cardId = null;
|
||||
}
|
||||
|
||||
private void drawText(java.util.List<String> strings) {
|
||||
text.setText("");
|
||||
StyledDocument doc = text.getStyledDocument();
|
||||
|
|
|
|||
|
|
@ -40,9 +40,8 @@ public class MageActionCallback implements ActionCallback {
|
|||
protected static DefaultActionCallback defaultCallback = DefaultActionCallback.getInstance();
|
||||
protected static Session session = MageFrame.getSession();
|
||||
private CardView popupCard;
|
||||
private Thread t;
|
||||
private int state = 0;
|
||||
private JComponent cardInfoPane;
|
||||
private volatile boolean state = false;
|
||||
|
||||
public MageActionCallback() {
|
||||
}
|
||||
|
|
@ -186,14 +185,17 @@ public class MageActionCallback implements ActionCallback {
|
|||
}
|
||||
|
||||
MageCard card = (MageCard) data.component;
|
||||
if (card.getOriginal().getId() != bigCard.getCardId()) {
|
||||
if (!state || card.getOriginal().getId() != bigCard.getCardId()) {
|
||||
synchronized (MageActionCallback.class) {
|
||||
if (card.getOriginal().getId() != bigCard.getCardId()) {
|
||||
if (!state || card.getOriginal().getId() != bigCard.getCardId()) {
|
||||
if (!state) {
|
||||
bigCard.resetCardId();
|
||||
}
|
||||
state = true;
|
||||
Image image = card.getImage();
|
||||
if (image != null && image instanceof BufferedImage) {
|
||||
image = ImageHelper.getResizedImage((BufferedImage) image, bigCard.getWidth(), bigCard.getHeight());
|
||||
bigCard.setCard(card.getOriginal().getId(), image, card.getOriginal().getRules(), card.isFoil());
|
||||
bigCard.showTextComponent();
|
||||
if (card.getOriginal().isAbility()) {
|
||||
bigCard.showTextComponent();
|
||||
} else {
|
||||
|
|
@ -232,6 +234,7 @@ public class MageActionCallback implements ActionCallback {
|
|||
@Override
|
||||
public void mouseExited(MouseEvent e, final TransferData data) {
|
||||
hidePopup();
|
||||
this.state = false;
|
||||
ArrowBuilder.removeAllArrows();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue