* Fixed that card name text was covered by next card beneath if cards are displayed close together (library search).

This commit is contained in:
LevelX2 2015-04-16 16:29:54 +02:00
parent b2fe13c8c8
commit d245ce1ad2
4 changed files with 23 additions and 1 deletions

View file

@ -150,6 +150,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
private JPanel cardArea;
private int yTextOffset = 10;
public CardPanel(CardView newGameCard, UUID gameId, final boolean loadImage, ActionCallback callback, final boolean foil, Dimension dimension) {
this.gameCard = newGameCard;
this.callback = callback;
@ -583,7 +585,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
ptText.setVisible(showText);
int titleX = Math.round(cardWidth * (20f / 480));
int titleY = Math.round(cardHeight * (9f / 680)) + 10; // TODO: Set to 0 if it's a card selection with small card offset (ike library search)
int titleY = Math.round(cardHeight * (9f / 680)) + yTextOffset;
titleText.setBounds(cardXOffset + titleX, cardYOffset + titleY, cardWidth - titleX, cardHeight - titleY);
Dimension ptSize = ptText.getPreferredSize();
@ -1203,5 +1205,10 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
public void componentHidden(ComponentEvent ce) {
}
@Override
public void setTextOffset(int yOffset) {
yTextOffset = yOffset;
}
}