mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1216200. Correct for negative spread values with inset box shadows. r=mstange
This commit is contained in:
parent
e02f306961
commit
857d67f29e
@ -815,8 +815,27 @@ ComputeRectsForInsetBoxShadow(IntSize aBlurRadius,
|
||||
ceil(cornerWidth) + rectBufferSize.width);
|
||||
aOutPathMargins = innerMargin;
|
||||
|
||||
IntSize minInnerSize(innerMargin.LeftRight() + 1,
|
||||
innerMargin.TopBottom() + 1);
|
||||
// If we have a negative spread radius, we would not have enough
|
||||
// size to actually do the blur. So the min size must be the abs() of the blur
|
||||
// and spread radius.
|
||||
IntSize minBlurSize(std::abs(aSpreadRadius.width) + std::abs(aBlurRadius.width),
|
||||
std::abs(aSpreadRadius.height) + std::abs(aBlurRadius.height));
|
||||
|
||||
IntMargin minInnerMargins = IntMargin(ceil(cornerHeight) + minBlurSize.height,
|
||||
ceil(cornerWidth) + minBlurSize.width,
|
||||
ceil(cornerHeight) + minBlurSize.height,
|
||||
ceil(cornerWidth) + minBlurSize.width);
|
||||
|
||||
IntSize minInnerSize(minInnerMargins.LeftRight() + 1,
|
||||
minInnerMargins.TopBottom() + 1);
|
||||
|
||||
if (aShadowClipRect.height < minInnerSize.height) {
|
||||
minInnerSize.height = aShadowClipRect.height;
|
||||
}
|
||||
|
||||
if (aShadowClipRect.width < minInnerSize.width) {
|
||||
minInnerSize.width = aShadowClipRect.width;
|
||||
}
|
||||
|
||||
// Then expand the outer rect based on the size between the inner/outer rects
|
||||
IntSize minOuterSize(minInnerSize);
|
||||
|
Loading…
Reference in New Issue
Block a user