Use static_cast

This commit is contained in:
Jonas Kvinge
2021-03-21 18:53:02 +01:00
parent f91a679cdf
commit 59bffed47f
80 changed files with 241 additions and 242 deletions

View File

@@ -454,13 +454,13 @@ void AlbumCoverChoiceController::ShowCover(const Song &song, const QPixmap &pixm
// Resize differently if monitor is in portrait mode
if (desktop_width < desktop_height) {
const int new_width = static_cast<double>(desktop_width) * 0.95;
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, Qt::SmoothTransformation));
}
}
else {
const int new_height = static_cast<double>(desktop_height) * 0.85;
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, Qt::SmoothTransformation));
}