Qt: Allow transparent padding for covers
Some checks are pending
Automated Builds / 💻 Windows (push) Waiting to run
Automated Builds / 🐧 Linux AppImage (push) Waiting to run
Automated Builds / 🐧 Linux Cross-Compiled AppImage (push) Waiting to run
Automated Builds / 📦 Linux Flatpak (push) Blocked by required conditions
Automated Builds / 🍎 MacOS (push) Waiting to run
Automated Builds / 📤 Create Release (push) Blocked by required conditions

Need to use a custom paint delegate instead...
This commit is contained in:
Stenzek 2025-09-16 02:15:57 +10:00
parent bb50fc9056
commit 9a1a8c226a
No known key found for this signature in database

View File

@ -118,7 +118,8 @@ static void resizeAndPadImage(QImage* image, int expected_width, int expected_he
if ((image_height < dpr_expected_height) != expand_to_fill)
yoffs = static_cast<int>(static_cast<qreal>((dpr_expected_height - image_height) / 2) / dpr);
QImage padded_image(dpr_expected_width, dpr_expected_height, expected_format);
QImage padded_image(dpr_expected_width, dpr_expected_height,
fill_with_top_left ? expected_format : QImage::Format_ARGB32_Premultiplied);
padded_image.setDevicePixelRatio(dpr);
if (fill_with_top_left)
padded_image.fill(image->pixel(0, 0));