forked from External/mage
[UI] Fixed stack cards offset
This commit is contained in:
parent
943ff0d78d
commit
b6e0544c95
2 changed files with 10 additions and 1 deletions
|
|
@ -63,6 +63,8 @@ public class Cards extends javax.swing.JPanel {
|
|||
|
||||
private static final Border emptyBorder = new EmptyBorder(0,0,0,0);
|
||||
|
||||
private int minOffsetY = 0;
|
||||
|
||||
/**
|
||||
* Defines whether component should be visible whenever there is no objects within.
|
||||
* True by default.
|
||||
|
|
@ -316,7 +318,7 @@ public class Cards extends javax.swing.JPanel {
|
|||
|
||||
int dx = 0;
|
||||
for (Component component : cards) {
|
||||
component.setLocation(dx, component.getLocation().y);
|
||||
component.setLocation(dx, Math.max(component.getLocation().y, minOffsetY));
|
||||
dx += ((CardPanel) component).getCardWidth() + GAP_X;
|
||||
}
|
||||
}
|
||||
|
|
@ -324,4 +326,8 @@ public class Cards extends javax.swing.JPanel {
|
|||
public void setZone(String zone) {
|
||||
this.zone = zone;
|
||||
}
|
||||
|
||||
public void setMinOffsetY(int minOffsetY) {
|
||||
this.minOffsetY = minOffsetY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue