[UI] Fixes #481 : removed gap and moved cards up so scrollbar doesn't hide part of the hand cards

This commit is contained in:
magenoxx 2014-08-11 15:24:03 +04:00
parent 5f040b218a
commit 26d763611a
2 changed files with 4 additions and 2 deletions

View file

@ -76,7 +76,7 @@ public final class GamePanel extends javax.swing.JPanel {
private static final Logger logger = Logger.getLogger(GamePanel.class); private static final Logger logger = Logger.getLogger(GamePanel.class);
private static final String YOUR_HAND = "Your hand"; private static final String YOUR_HAND = "Your hand";
private static final int X_PHASE_WIDTH = 55; private static final int X_PHASE_WIDTH = 55;
public static final int STACK_MIN_CARDS_OFFSET_Y = 7; private static final int STACK_MIN_CARDS_OFFSET_Y = 7;
private final Map<UUID, PlayAreaPanel> players = new HashMap<>(); private final Map<UUID, PlayAreaPanel> players = new HashMap<>();
private final Map<UUID, ExileZoneDialog> exiles = new HashMap<>(); private final Map<UUID, ExileZoneDialog> exiles = new HashMap<>();
private final Map<String, ShowCardsDialog> revealed = new HashMap<>(); private final Map<String, ShowCardsDialog> revealed = new HashMap<>();
@ -1238,7 +1238,7 @@ public final class GamePanel extends javax.swing.JPanel {
//.addPreferredGap(ComponentPlacement.RELATED) //.addPreferredGap(ComponentPlacement.RELATED)
.addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING) .addGroup(gl_jPanel3.createParallelGroup(Alignment.LEADING)
.addGroup(gl_jPanel3.createSequentialGroup() .addGroup(gl_jPanel3.createSequentialGroup()
.addGap(85) .addGap(80)
.addComponent(stack, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(stack, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
) )
.addGroup(gl_jPanel3.createSequentialGroup() .addGroup(gl_jPanel3.createSequentialGroup()

View file

@ -17,6 +17,7 @@ public class HandPanel extends JPanel {
private static final int CARD_WIDTH = 75; private static final int CARD_WIDTH = 75;
private static final double ASPECT_RATIO = 3.5 / 2.5; private static final double ASPECT_RATIO = 3.5 / 2.5;
private static final int HAND_MIN_CARDS_OFFSET_Y = -10;
private boolean smallMode = false; private boolean smallMode = false;
private Dimension handCardDimensionBig; private Dimension handCardDimensionBig;
@ -31,6 +32,7 @@ public class HandPanel extends JPanel {
public void initComponents() { public void initComponents() {
hand = new mage.client.cards.Cards(true); hand = new mage.client.cards.Cards(true);
hand.setCardDimension(getHandCardDimension()); hand.setCardDimension(getHandCardDimension());
hand.setMinOffsetY(HAND_MIN_CARDS_OFFSET_Y);
jPanel = new JPanel(); jPanel = new JPanel();
jScrollPane1 = new JScrollPane(jPanel); jScrollPane1 = new JScrollPane(jPanel);