Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(686)

Unified Diff: Source/core/paint/BoxPainter.cpp

Issue 1137513003: Apply bleed-avoidance insets _after_ constraining the border (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: One more TE. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/BoxPainter.h ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/BoxPainter.cpp
diff --git a/Source/core/paint/BoxPainter.cpp b/Source/core/paint/BoxPainter.cpp
index e0acf8f6fa76770d308ece366c9d46db48c7cc00..efeaf5eceaeef4ae23bf487982c22b740d70a34b 100644
--- a/Source/core/paint/BoxPainter.cpp
+++ b/Source/core/paint/BoxPainter.cpp
@@ -264,16 +264,14 @@ void BoxPainter::applyBoxShadowForBackground(GraphicsContext* context, LayoutObj
FloatRoundedRect BoxPainter::getBackgroundRoundedRect(LayoutObject& obj, const LayoutRect& borderRect,
InlineFlowBox* box, LayoutUnit inlineBoxWidth, LayoutUnit inlineBoxHeight,
- bool includeLogicalLeftEdge, bool includeLogicalRightEdge, const FloatRectOutsets* insets)
+ bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
{
- FloatRoundedRect border = obj.style()->getRoundedBorderFor(borderRect, includeLogicalLeftEdge,
- includeLogicalRightEdge, insets);
+ FloatRoundedRect border = obj.style()->getRoundedBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge);
if (box && (box->nextLineBox() || box->prevLineBox())) {
FloatRoundedRect segmentBorder = obj.style()->getRoundedBorderFor(LayoutRect(0, 0, inlineBoxWidth, inlineBoxHeight),
- includeLogicalLeftEdge, includeLogicalRightEdge, insets);
+ includeLogicalLeftEdge, includeLogicalRightEdge);
border.setRadii(segmentBorder.radii());
}
-
return border;
}
@@ -305,8 +303,13 @@ FloatRoundedRect BoxPainter::backgroundRoundedRectAdjustedForBleedAvoidance(Layo
-fractionalInset * edges[BSBottom].width,
-fractionalInset * edges[BSLeft].width);
- return getBackgroundRoundedRect(obj, borderRect, box, boxSize.width(), boxSize.height(),
- includeLogicalLeftEdge, includeLogicalRightEdge, &insets);
+ FloatRoundedRect backgroundRoundedRect = getBackgroundRoundedRect(obj, borderRect, box, boxSize.width(), boxSize.height(),
+ includeLogicalLeftEdge, includeLogicalRightEdge);
+ FloatRect insetRect(backgroundRoundedRect.rect());
+ insetRect.expand(insets);
+ FloatRoundedRect::Radii insetRadii(backgroundRoundedRect.radii());
+ insetRadii.shrink(-insets.top(), -insets.bottom(), -insets.left(), -insets.right());
+ return FloatRoundedRect(insetRect, insetRadii);
}
if (bleedAvoidance == BackgroundBleedBackgroundOverBorder)
return obj.style()->getRoundedInnerBorderFor(borderRect, includeLogicalLeftEdge, includeLogicalRightEdge);
« no previous file with comments | « Source/core/paint/BoxPainter.h ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698