mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
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.
This commit is contained in:
parent
f0a1938b3e
commit
a638625c77
3 changed files with 9 additions and 2 deletions
|
@ -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()));
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue