Fix so selected card appears on top

This commit is contained in:
drdev
2014-04-16 03:54:42 +00:00
parent b9a1556a2a
commit 908a0ccfe9
2 changed files with 9 additions and 2 deletions

View File

@@ -192,6 +192,10 @@ public class InputSelectCard {
w = owner.getHeight();
y = pos.y + owner.getHeight() - h;
}
if (owner.getAttachedToPanel() != null) {
//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);
}
}

View File

@@ -53,10 +53,13 @@ public class FCardPanel extends FDisplayObject {
@Override
public void draw(Graphics g) {
draw(g, 0, 0);
}
public void draw(Graphics g, float x, float y) {
if (card == null) { return; }
float x = PADDING;
float y = PADDING;
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