Chromium Code Reviews| Index: Source/core/rendering/style/BasicShapes.cpp |
| diff --git a/Source/core/rendering/style/BasicShapes.cpp b/Source/core/rendering/style/BasicShapes.cpp |
| index 74c13eeb3f878146efb57a048123a9f828902b0b..c83c9579a5398a35ea124ebffba649ddefb7bb62 100644 |
| --- a/Source/core/rendering/style/BasicShapes.cpp |
| +++ b/Source/core/rendering/style/BasicShapes.cpp |
| @@ -31,6 +31,7 @@ |
| #include "core/rendering/style/BasicShapes.h" |
| #include "core/css/BasicShapeFunctions.h" |
| +#include "core/rendering/style/RenderStyle.h" |
| #include "platform/CalculationValue.h" |
| #include "platform/LengthFunctions.h" |
| #include "platform/geometry/FloatRect.h" |
| @@ -227,18 +228,15 @@ void BasicShapeInset::path(Path& path, const FloatRect& boundingBox) |
| ASSERT(path.isEmpty()); |
| float left = floatValueForLength(m_left, boundingBox.width()); |
| float top = floatValueForLength(m_top, boundingBox.height()); |
| - path.addRoundedRect( |
| - FloatRect( |
| - left + boundingBox.x(), |
| - top + boundingBox.y(), |
| - std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0), |
| - std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0) |
| - ), |
| - floatSizeForLengthSize(m_topLeftRadius, boundingBox), |
| + auto rect = FloatRect(left + boundingBox.x(), top + boundingBox.y(), |
|
leviw_travelin_and_unemployed
2015/01/17 00:18:22
Nit: I don't think auto makes things clearer here.
|
| + std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0), |
| + std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0)); |
| + auto radii = FloatRoundedRect::Radii(floatSizeForLengthSize(m_topLeftRadius, boundingBox), |
| floatSizeForLengthSize(m_topRightRadius, boundingBox), |
| floatSizeForLengthSize(m_bottomLeftRadius, boundingBox), |
| - floatSizeForLengthSize(m_bottomRightRadius, boundingBox) |
| - ); |
| + floatSizeForLengthSize(m_bottomRightRadius, boundingBox)); |
| + radii.scale(calcBorderRadiiConstraintScaleFor(rect, radii)); |
| + path.addRoundedRect(FloatRoundedRect(rect, radii)); |
| } |
| static inline LengthSize blendLengthSize(const LengthSize& to, const LengthSize& from, double progress) |