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.5 Fixes: QTBUG-114849 Change-Id: I311e7401e61425efb20b37d13cc95c4b22d47e76 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 7cb25eb33c7875c913b4cb0154afd741e602d8aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
cb09b3967e
commit
a06b26814d
@ -845,7 +845,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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user