mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Ensure animation card panels are disposed
This commit is contained in:
@@ -142,8 +142,8 @@ public class CHand implements ICDoc {
|
|||||||
endX = toPos.x;
|
endX = toPos.x;
|
||||||
endY = toPos.y;
|
endY = toPos.y;
|
||||||
|
|
||||||
final CardPanel animationPanel = new CardPanel(placeholder.getGameCard());
|
|
||||||
if (Singletons.getView().getFrame().isShowing()) {
|
if (Singletons.getView().getFrame().isShowing()) {
|
||||||
|
final CardPanel animationPanel = new CardPanel(placeholder.getGameCard());
|
||||||
Animation.moveCard(startX, startY, startWidth, endX, endY, endWidth, animationPanel, placeholder,
|
Animation.moveCard(startX, startY, startWidth, endX, endY, endWidth, animationPanel, placeholder,
|
||||||
layeredPane, 500);
|
layeredPane, 500);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,6 @@ public class CardPanel extends JPanel implements CardContainer, IDisposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Setter for the field <code>displayEnabled</code>.
|
* Setter for the field <code>displayEnabled</code>.
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import java.util.TimerTask;
|
|||||||
import javax.swing.JLayeredPane;
|
import javax.swing.JLayeredPane;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.view.arcane.CardPanel;
|
import forge.view.arcane.CardPanel;
|
||||||
|
|
||||||
|
|
||||||
@@ -392,6 +393,9 @@ public abstract class Animation {
|
|||||||
animationPanel.setVisible(false);
|
animationPanel.setVisible(false);
|
||||||
animationPanel.repaint();
|
animationPanel.repaint();
|
||||||
layeredPane.remove(animationPanel);
|
layeredPane.remove(animationPanel);
|
||||||
|
if (animationPanel != CardPanel.getDragAnimationPanel()) {
|
||||||
|
FSkin.dispose(animationPanel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user