UI fix for attachments z-order

This commit is contained in:
magenoxx 2012-05-25 10:19:31 +04:00
parent 0335d4d77e
commit 675d2f1183

View file

@ -202,6 +202,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
} }
} }
} else { } else {
int index = permanent.getAttachments().size();
for (UUID attachmentId: permanent.getAttachments()) { for (UUID attachmentId: permanent.getAttachments()) {
MagePermanent link = permanents.get(attachmentId); MagePermanent link = permanents.get(attachmentId);
if (link != null) { if (link != null) {
@ -211,8 +212,11 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
perm.setBounds(r); perm.setBounds(r);
moveToFront(link); moveToFront(link);
moveToFront(perm); moveToFront(perm);
jPanel.setComponentZOrder(link, index);
index--;
} }
} }
jPanel.setComponentZOrder(perm, index);
} }
} }