QIconLoader::actualSize(): respect entry.scale on returned size

entryForSize() might return an entry with a scale != 1 (e.g. when
requesting the actual size for 32x32 it might return an entry with
size=16 and scale=2) but the returned size is not multiplied with this
scale so it returns a wrong size and in the case of QTBUG-114849 to a
wrong painting rect.

Pick-to: 6.6 6.5
Fixes: QTBUG-114849
Change-Id: I311e7401e61425efb20b37d13cc95c4b22d47e76
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Christian Ehrlicher 2023-12-03 21:41:31 +01:00
parent 4b666553b8
commit 7cb25eb33c
1 changed files with 1 additions and 1 deletions

View File

@ -853,7 +853,7 @@ QSize QIconLoaderEngine::actualSize(const QSize &size, QIcon::Mode mode,
} else if (dir.type == QIconDirInfo::Fallback) {
return QIcon(entry->filename).actualSize(size, mode, state);
} else {
int result = qMin<int>(dir.size, qMin(size.width(), size.height()));
int result = qMin<int>(dir.size * dir.scale, qMin(size.width(), size.height()));
return QSize(result, result);
}
}