Fixed Issue#454: offset for enchanted permanents

This commit is contained in:
magenoxx 2014-07-24 12:18:20 +04:00
parent c17be6c3ab
commit b52e526c0f
2 changed files with 6 additions and 16 deletions

View file

@ -9,6 +9,7 @@ import mage.client.plugins.adapters.MageActionCallback;
import mage.client.plugins.impl.Plugins; import mage.client.plugins.impl.Plugins;
import mage.client.util.audio.AudioManager; import mage.client.util.audio.AudioManager;
import mage.components.ImagePanel; import mage.components.ImagePanel;
import mage.constants.AbilityType;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.EnlargeMode; import mage.constants.EnlargeMode;
import mage.utils.CardUtil; import mage.utils.CardUtil;
@ -31,8 +32,6 @@ import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.constants.AbilityType;
import mage.constants.MageObjectType;
/** /**
* Main class for drawing Mage card object. * Main class for drawing Mage card object.
@ -310,16 +309,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
} }
private void setText(CardView card) { private void setText(CardView card) {
if (displayTitleAnyway) { titleText.setText(!displayTitleAnyway && hasImage ? "" : card.getName());
titleText.setText(card.getName());
return;
}
if (hasImage) {
titleText.setText("");
} else {
titleText.setText(card.getName());
}
} }
private void setImage(Image srcImage) { private void setImage(Image srcImage) {

View file

@ -47,14 +47,13 @@ public class CardPluginImpl implements CardPlugin {
private static final Logger log = Logger.getLogger(CardPluginImpl.class); private static final Logger log = Logger.getLogger(CardPluginImpl.class);
private static final int ATTACHMENT_DY_OFFSET = 10;
private static final int GUTTER_Y = 15; private static final int GUTTER_Y = 15;
private static final int GUTTER_X = 5; private static final int GUTTER_X = 5;
static final float EXTRA_CARD_SPACING_X = 0.04f; static final float EXTRA_CARD_SPACING_X = 0.04f;
private static final float CARD_SPACING_Y = 0.03f; private static final float CARD_SPACING_Y = 0.03f;
private static final float STACK_SPACING_X = 0.07f; private static final float STACK_SPACING_X = 0.07f;
private static final float STACK_SPACING_Y = 0.13f; private static final float STACK_SPACING_Y = 0.13f;
private static final float ATTACHMENT_SPACING_Y = 0.13f;
private int landStackMax = 5; private int landStackMax = 5;
private int cardWidthMin = 50, cardWidthMax = Constants.CARD_SIZE_FULL.width; private int cardWidthMin = 50, cardWidthMax = Constants.CARD_SIZE_FULL.width;
@ -63,7 +62,7 @@ public class CardPluginImpl implements CardPlugin {
private int playAreaWidth, playAreaHeight; private int playAreaWidth, playAreaHeight;
private int cardWidth, cardHeight; private int cardWidth, cardHeight;
private int extraCardSpacingX, cardSpacingX, cardSpacingY; private int extraCardSpacingX, cardSpacingX, cardSpacingY;
private int stackSpacingX, stackSpacingY; private int stackSpacingX, stackSpacingY, attachmentSpacingY;
private List<Row> rows = new ArrayList<>(); private List<Row> rows = new ArrayList<>();
@Init @Init
@ -185,6 +184,7 @@ public class CardPluginImpl implements CardPlugin {
cardSpacingY = Math.round(cardHeight * CARD_SPACING_Y); cardSpacingY = Math.round(cardHeight * CARD_SPACING_Y);
stackSpacingX = stackVertical ? 0 : Math.round(cardWidth * STACK_SPACING_X); stackSpacingX = stackVertical ? 0 : Math.round(cardWidth * STACK_SPACING_X);
stackSpacingY = Math.round(cardHeight * STACK_SPACING_Y); stackSpacingY = Math.round(cardHeight * STACK_SPACING_Y);
attachmentSpacingY = Math.round(cardHeight * ATTACHMENT_SPACING_Y);
Row creatures = (Row) allCreatures.clone(); Row creatures = (Row) allCreatures.clone();
Row lands = (Row) allLands.clone(); Row lands = (Row) allLands.clone();
Row others = (Row) allOthers.clone(); Row others = (Row) allOthers.clone();
@ -449,7 +449,7 @@ public class CardPluginImpl implements CardPlugin {
} }
private int getHeight() { private int getHeight() {
return cardHeight + (size() - 1) * stackSpacingY + cardSpacingY + ATTACHMENT_DY_OFFSET*maxAttachedCount; return cardHeight + (size() - 1) * stackSpacingY + cardSpacingY + attachmentSpacingY*maxAttachedCount;
} }
public int getMaxAttachedCount() { public int getMaxAttachedCount() {