Skip to content

Commit

Permalink
fix moving card from cell
Browse files Browse the repository at this point in the history
  • Loading branch information
radekp committed Apr 15, 2012
1 parent ba29bd9 commit 6199752
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions freecellview.cpp
Expand Up @@ -292,8 +292,16 @@ void FreecellView::paintEvent(QPaintEvent * event)

if (card_selected) {
if (mouseX >= 0 && mouseY >= 0) {
QPixmap pm =
cardpics[cards.getCard(selected_card.x, selected_card.y)];
int card;

if(selected_card.y == -1) {
card = cards.getBoxCard(selected_card.x);
}
else {
card = cards.getCard(selected_card.x, selected_card.y);
}

QPixmap pm = cardpics[card];
p.drawPixmap(mouseX - CARD_WIDTH / 2, mouseY - CARD_HEIGHT / 2, pm);
}
}
Expand Down

0 comments on commit 6199752

Please sign in to comment.