mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
fix NPE when trying to draw PT on an emblem.
This commit is contained in:
parent
89cf3e3969
commit
e63ba29427
1 changed files with 13 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue