mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix card highlight thickness
This commit is contained in:
@@ -343,7 +343,7 @@ public class InputSelectCard {
|
|||||||
//redraw owner if needed so it appears on top of cards above it in stack
|
//redraw owner if needed so it appears on top of cards above it in stack
|
||||||
owner.draw(g, pos.x, pos.y);
|
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();
|
w = getWidth();
|
||||||
x = w / 2;
|
x = w / 2;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public abstract class VCardDisplayArea extends VDisplayArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected float getCardWidth(float cardHeight) {
|
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
|
@Override
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ import forge.util.Utils;
|
|||||||
public class FCardPanel extends FDisplayObject {
|
public class FCardPanel extends FDisplayObject {
|
||||||
public static final float TAPPED_ANGLE = -90;
|
public static final float TAPPED_ANGLE = -90;
|
||||||
public static final float ASPECT_RATIO = 3.5f / 2.5f;
|
public static final float ASPECT_RATIO = 3.5f / 2.5f;
|
||||||
public static final float PADDING_X = Utils.scaleX(2);
|
public static final float PADDING = Utils.scaleMin(2);
|
||||||
public static final float PADDING_Y = Utils.scaleY(2);
|
|
||||||
|
|
||||||
private Card card;
|
private Card card;
|
||||||
private boolean tapped;
|
private boolean tapped;
|
||||||
@@ -60,10 +59,10 @@ public class FCardPanel extends FDisplayObject {
|
|||||||
public void draw(Graphics g, float x, float y) {
|
public void draw(Graphics g, float x, float y) {
|
||||||
if (card == null) { return; }
|
if (card == null) { return; }
|
||||||
|
|
||||||
x += PADDING_X;
|
x += PADDING;
|
||||||
y += PADDING_Y;
|
y += PADDING;
|
||||||
float w = getWidth() - 2 * PADDING_X;
|
float w = getWidth() - 2 * PADDING;
|
||||||
float h = getHeight() - 2 * PADDING_Y;
|
float h = getHeight() - 2 * PADDING;
|
||||||
if (w == h) { //adjust width if needed to make room for tapping
|
if (w == h) { //adjust width if needed to make room for tapping
|
||||||
w = h / ASPECT_RATIO;
|
w = h / ASPECT_RATIO;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user