diff --git a/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp b/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp index 2420d85c9..ea7378dbc 100644 --- a/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp +++ b/cockatrice/src/dialogs/dlg_select_set_for_cards.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -279,11 +280,11 @@ void DlgSelectSetForCards::dropEvent(QDropEvent *event) { QByteArray itemData = event->mimeData()->data("application/x-setentrywidget"); QString draggedSetName = QString::fromUtf8(itemData); - + QPoint adjustedPos = event->position().toPoint() + QPoint(0, scrollArea->verticalScrollBar()->value()); int dropIndex = -1; for (int i = 0; i < listLayout->count(); ++i) { QWidget *widget = listLayout->itemAt(i)->widget(); - if (widget && widget->geometry().contains(event->position().toPoint())) { + if (widget && widget->geometry().contains(adjustedPos)) { dropIndex = i; break; }