mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1251644 - Snap object-contain fit if we were going to reduce the size by less than one css pixel. r=seth
This commit is contained in:
parent
baaa0fca1d
commit
daea81cf90
@ -4990,9 +4990,17 @@ nsImageRenderer::ComputeConstrainedSize(const nsSize& aConstrainingSize,
|
||||
size.width = aConstrainingSize.width;
|
||||
size.height = NSCoordSaturatingNonnegativeMultiply(
|
||||
aIntrinsicRatio.height, scaleX);
|
||||
// If we're reducing the size by less than one css pixel, then just use the
|
||||
// constraining size.
|
||||
if (aFitType == CONTAIN && aConstrainingSize.height - size.height < nsPresContext::AppUnitsPerCSSPixel()) {
|
||||
size.height = aConstrainingSize.height;
|
||||
}
|
||||
} else {
|
||||
size.width = NSCoordSaturatingNonnegativeMultiply(
|
||||
aIntrinsicRatio.width, scaleY);
|
||||
if (aFitType == CONTAIN && aConstrainingSize.width - size.width < nsPresContext::AppUnitsPerCSSPixel()) {
|
||||
size.width = aConstrainingSize.width;
|
||||
}
|
||||
size.height = aConstrainingSize.height;
|
||||
}
|
||||
return size;
|
||||
|
Loading…
Reference in New Issue
Block a user