mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
Use QPixmapCache for card images
Drop CardInfo’s own pixmap caches; use QPixmapCache instead. Use QPixmap references instead of pointers. Being stored in QPixmapCache, all card images are now subjected to QPixmapCache’s size limit
This commit is contained in:
parent
b96104bed4
commit
f88621fd97
5 changed files with 71 additions and 69 deletions
|
|
@ -188,11 +188,12 @@ void CardInfoWidget::updatePixmap()
|
|||
if (pixmapWidth == 0)
|
||||
return;
|
||||
|
||||
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio));
|
||||
if (resizedPixmap)
|
||||
cardPicture->setPixmap(*resizedPixmap);
|
||||
else
|
||||
cardPicture->setPixmap(*(getCard()->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio))));
|
||||
QPixmap resizedPixmap;
|
||||
info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio), resizedPixmap);
|
||||
|
||||
if (resizedPixmap.isNull())
|
||||
getCard()->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio), resizedPixmap);
|
||||
cardPicture->setPixmap(resizedPixmap);
|
||||
}
|
||||
|
||||
void CardInfoWidget::retranslateUi()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue