fix NPE when trying to draw PT on an emblem.

This commit is contained in:
John Hitchings 2019-05-13 22:51:30 -07:00
parent 89cf3e3969
commit e63ba29427

View file

@ -622,6 +622,7 @@ public class CardPanelComponentImpl extends CardPanel {
fullImageText.setBounds(titleText.getX(), titleText.getY(), titleText.getBounds().width, titleText.getBounds().height);
// PT (font as title)
if (getGameCard().getOriginalCard() != null) {
prepareGlowFont(ptText1, Math.max(CARD_PT_FONT_MIN_SIZE, fontSize), getGameCard().getOriginalCard().getPower(), false);
prepareGlowFont(ptText2, Math.max(CARD_PT_FONT_MIN_SIZE, fontSize), null, false);
prepareGlowFont(ptText3, Math.max(CARD_PT_FONT_MIN_SIZE, fontSize), getGameCard().getOriginalCard().getToughness(), CardRendererUtils.isCardWithDamage(getGameCard()));
@ -635,6 +636,7 @@ public class CardPanelComponentImpl extends CardPanel {
int ptX = cardXOffset + ptMarginRight;
int ptY = cardYOffset + cardHeight - ptMarginBottom - ptHeight;
ptPanel.setBounds(ptX, ptY, ptWidth, ptHeight);
}
// old version was with TEXT_GLOW_SIZE
//ptText.setLocation(cardXOffset + ptX - TEXT_GLOW_SIZE / 2 - offsetX, cardYOffset + ptY - TEXT_GLOW_SIZE / 2);