Fix card highlight thickness

This commit is contained in:
drdev
2014-05-11 20:42:43 +00:00
parent 3ea7b8a9ff
commit 9a2b0c1657
3 changed files with 7 additions and 8 deletions

View File

@@ -343,7 +343,7 @@ public class InputSelectCard {
//redraw owner if needed so it appears on top of cards above it in stack
owner.draw(g, pos.x, pos.y);
}
g.drawRect(2, Color.GREEN, x, y, w, h);
g.drawRect(FCardPanel.PADDING, Color.GREEN, x, y, w, h);
w = getWidth();
x = w / 2;

View File

@@ -98,7 +98,7 @@ public abstract class VCardDisplayArea extends VDisplayArea {
}
protected float getCardWidth(float cardHeight) {
return (cardHeight - 2 * CardAreaPanel.PADDING_Y) / CardAreaPanel.ASPECT_RATIO + 2 * CardAreaPanel.PADDING_X; //ensure aspect ratio maintained after padding applied
return (cardHeight - 2 * CardAreaPanel.PADDING) / CardAreaPanel.ASPECT_RATIO + 2 * CardAreaPanel.PADDING; //ensure aspect ratio maintained after padding applied
}
@Override

View File

@@ -10,8 +10,7 @@ import forge.util.Utils;
public class FCardPanel extends FDisplayObject {
public static final float TAPPED_ANGLE = -90;
public static final float ASPECT_RATIO = 3.5f / 2.5f;
public static final float PADDING_X = Utils.scaleX(2);
public static final float PADDING_Y = Utils.scaleY(2);
public static final float PADDING = Utils.scaleMin(2);
private Card card;
private boolean tapped;
@@ -60,10 +59,10 @@ public class FCardPanel extends FDisplayObject {
public void draw(Graphics g, float x, float y) {
if (card == null) { return; }
x += PADDING_X;
y += PADDING_Y;
float w = getWidth() - 2 * PADDING_X;
float h = getHeight() - 2 * PADDING_Y;
x += PADDING;
y += PADDING;
float w = getWidth() - 2 * PADDING;
float h = getHeight() - 2 * PADDING;
if (w == h) { //adjust width if needed to make room for tapping
w = h / ASPECT_RATIO;
}