mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 10:04:46 -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
|
|
@ -41,13 +41,14 @@ void CardInfoPicture::updatePixmap()
|
|||
return;
|
||||
}
|
||||
|
||||
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio));
|
||||
if (resizedPixmap) {
|
||||
setNoPicture(false);
|
||||
this->setPixmap(*resizedPixmap);
|
||||
}
|
||||
else {
|
||||
QPixmap resizedPixmap;
|
||||
info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio), resizedPixmap);
|
||||
|
||||
if (resizedPixmap.isNull()) {
|
||||
setNoPicture(true);
|
||||
this->setPixmap(*(db->getCard()->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio))));
|
||||
db->getCard()->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio), resizedPixmap);
|
||||
} else {
|
||||
setNoPicture(false);
|
||||
}
|
||||
this->setPixmap(resizedPixmap);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue