зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1207958 - Fix heuristic for choosing which ICO sub-image to render - r=tn
This commit is contained in:
Родитель
93611e5b4c
Коммит
4623e471a3
|
@ -235,8 +235,8 @@ nsICODecoder::ReadDirEntry(const char* aData)
|
|||
// choose the smallest resource that is >= the target size (i.e. we assume
|
||||
// it's better to downscale a larger icon than to upscale a smaller one).
|
||||
IntSize desiredSize = mDownscaler->TargetSize();
|
||||
int32_t delta = entrySize.width - desiredSize.width +
|
||||
entrySize.height - desiredSize.height;
|
||||
int32_t delta = std::min(entrySize.width - desiredSize.width,
|
||||
entrySize.height - desiredSize.height);
|
||||
if (e.mBitCount >= mBestResourceColorDepth &&
|
||||
((mBestResourceDelta < 0 && delta >= mBestResourceDelta) ||
|
||||
(delta >= 0 && delta <= mBestResourceDelta))) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче