mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[Cards] Guard against null QScreen when positioning enlarged pixmap (#7650)
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
This commit is contained in:
parent
93309e01a2
commit
f3fb3331d1
1 changed files with 8 additions and 1 deletions
|
|
@ -491,7 +491,14 @@ void CardInfoPictureWidget::showEnlargedPixmap()
|
|||
enlargedPixmapWidget->setCardPixmap(exactCard, enlargedSize);
|
||||
|
||||
const QPoint cursorPos = QCursor::pos();
|
||||
const QRect screenGeometry = QGuiApplication::screenAt(cursorPos)->geometry();
|
||||
QScreen *screen = QGuiApplication::screenAt(cursorPos);
|
||||
if (!screen) {
|
||||
screen = QGuiApplication::primaryScreen();
|
||||
}
|
||||
if (!screen) {
|
||||
return;
|
||||
}
|
||||
const QRect screenGeometry = screen->geometry();
|
||||
const QSize widgetSize = enlargedPixmapWidget->size();
|
||||
|
||||
int newX = cursorPos.x() + ENLARGED_PIXMAP_OFFSET;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue