Add static_cast to silence narrowing conversion warnings

This commit is contained in:
Jonas Kvinge
2023-06-06 23:18:49 +02:00
parent e2f9411b46
commit 8ee32dfa88
9 changed files with 50 additions and 50 deletions

View File

@@ -491,13 +491,13 @@ void AlbumCoverChoiceController::ShowCover(const Song &song, const QPixmap &pixm
if (desktop_width < desktop_height) {
const int new_width = static_cast<int>(static_cast<double>(desktop_width) * 0.95);
if (new_width < pixmap.width()) {
label->setPixmap(pixmap.scaledToWidth(new_width * pixmap.devicePixelRatioF(), Qt::SmoothTransformation));
label->setPixmap(pixmap.scaledToWidth(static_cast<int>(new_width * pixmap.devicePixelRatioF()), Qt::SmoothTransformation));
}
}
else {
const int new_height = static_cast<int>(static_cast<double>(desktop_height) * 0.85);
if (new_height < pixmap.height()) {
label->setPixmap(pixmap.scaledToHeight(new_height * pixmap.devicePixelRatioF(), Qt::SmoothTransformation));
label->setPixmap(pixmap.scaledToHeight(static_cast<int>(new_height * pixmap.devicePixelRatioF()), Qt::SmoothTransformation));
}
}