From a638625c7746630921bea202025bf83d8e04a7a7 Mon Sep 17 00:00:00 2001 From: Mark Langen Date: Wed, 7 Sep 2016 17:35:05 -0600 Subject: [PATCH] Fixed full-arts seemingly not replicating properly * The problem was that they key for caching rendered cards did not take into account the full art / not full artness of the cards, so when someone has both full art and non-full art variants of a land from the same set it one would override the other. --- .../main/java/org/mage/card/arcane/CardPanelRenderImpl.java | 4 ++++ .../main/java/org/mage/card/arcane/ModernCardRenderer.java | 5 +++-- Mage.Common/src/mage/view/CardView.java | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelRenderImpl.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelRenderImpl.java index 43a467d92f..97ab5c06d9 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelRenderImpl.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanelRenderImpl.java @@ -66,6 +66,9 @@ public class CardPanelRenderImpl extends CardPanel { if (!a.getExpansionSetCode().equals(b.getExpansionSetCode())) { return false; } + if (a.getFrameStyle() != b.getFrameStyle()) { + return false; + } if (a.getCounters() == null) { if (b.getCounters() != null) { return false; @@ -121,6 +124,7 @@ public class CardPanelRenderImpl extends CardPanel { sb.append((char) (this.view.isPlayable() ? 1 : 0)); sb.append((char) (this.view.isCanAttack() ? 1 : 0)); sb.append((char) (this.view.isFaceDown() ? 1 : 0)); + sb.append((char) this.view.getFrameStyle().ordinal()); if (this.view instanceof PermanentView) { sb.append((char) (((PermanentView) this.view).hasSummoningSickness() ? 1 : 0)); sb.append((char) (((PermanentView) this.view).getDamage())); diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java b/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java index d43377b31a..be9c04cd46 100644 --- a/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java +++ b/Mage.Client/src/main/java/org/mage/card/arcane/ModernCardRenderer.java @@ -206,6 +206,7 @@ public class ModernCardRenderer extends CardRenderer { BOX_HEIGHT_FRAC * cardHeight); // Type line at + LOGGER.info("Draw, " + cardView.getFrameStyle() + ", " + cardView.getFrameStyle().isFullArt()); typeLineY = (int)(getTypeLineYFrac() * cardHeight); // Box text height @@ -297,7 +298,7 @@ public class ModernCardRenderer extends CardRenderer { */ private Rectangle2D getArtRect() { Rectangle2D rect; - if (cardView.getFrameStyle().isFullArt()) { + if (cardView.getFrameStyle().isFullArt() || cardView.isToken()) { rect = new Rectangle2D.Float(.079f, .11f, .84f, .63f); } else { rect = new Rectangle2D.Float(.079f, .11f, .84f, .42f); @@ -307,7 +308,7 @@ public class ModernCardRenderer extends CardRenderer { private float getTypeLineYFrac() { if (cardView.isToken()) { - return TYPE_LINE_Y_FRAC; + return TYPE_LINE_Y_FRAC_TOKEN; } else if (cardView.getFrameStyle().isFullArt()) { return TYPE_LINE_Y_FRAC_FULL_ART; } else { diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java index aadc38d4ca..7d1c2fd288 100644 --- a/Mage.Common/src/mage/view/CardView.java +++ b/Mage.Common/src/mage/view/CardView.java @@ -30,6 +30,7 @@ package mage.view; import java.util.ArrayList; import java.util.List; import java.util.UUID; + import mage.MageObject; import mage.ObjectColor; import mage.abilities.Mode; @@ -54,6 +55,7 @@ import mage.game.stack.Spell; import mage.game.stack.StackAbility; import mage.target.Target; import mage.target.Targets; +import org.apache.log4j.Logger; /** * @author BetaSteward_at_googlemail.com