Skip to content

Commit

Permalink
GUI: fixed that dungeon card hint doesn't hide after choose dialog, f…
Browse files Browse the repository at this point in the history
…ixed working card hint on empty space in choose dialog (#8012);
  • Loading branch information
JayDi85 committed Aug 30, 2021
1 parent 1809fb5 commit 8bd1a9c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Mage.Client/src/main/java/mage/client/dialog/PickChoiceDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ public void mouseExited(MouseEvent e) {
public void mouseMoved(MouseEvent e) {
// hint show
JList listSource = (JList) e.getSource();
int index = listSource.locationToIndex(e.getPoint());

// workaround to raise on real element, not empty space
int index = -1;
Rectangle r = listSource.getCellBounds(0, listSource.getLastVisibleIndex());
if (r != null && r.contains(e.getPoint())) {
index = listSource.locationToIndex(e.getPoint());
}

if (index > -1) {
choiceHintShow(index);
} else {
Expand Down Expand Up @@ -255,7 +262,8 @@ private void choiceHintShow(int modelIndex) {

private void choiceHintHide() {
switch (choice.getHintType()) {
case CARD: {
case CARD:
case CARD_DUNGEON: {
// as popup card
cardInfo.onMouseExited();
break;
Expand Down

0 comments on commit 8bd1a9c

Please sign in to comment.