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

Unified Diff: Source/core/rendering/shapes/Shape.cpp

Issue 195793009: [CSS Shapes] inset does not properly clamp large corner radii (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove the explicit inline Created 6 years, 9 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
Index: Source/core/rendering/shapes/Shape.cpp
diff --git a/Source/core/rendering/shapes/Shape.cpp b/Source/core/rendering/shapes/Shape.cpp
index ea562f3e557f13772f8f1679cb0aa14f318488c7..497fdb18dd88bc9e7e0043fa6a5ea0e25a8f24c7 100644
--- a/Source/core/rendering/shapes/Shape.cpp
+++ b/Source/core/rendering/shapes/Shape.cpp
@@ -36,8 +36,8 @@
#include "core/rendering/shapes/PolygonShape.h"
#include "core/rendering/shapes/RasterShape.h"
#include "core/rendering/shapes/RectangleShape.h"
+#include "core/rendering/style/RenderStyle.h"
#include "platform/LengthFunctions.h"
-#include "platform/geometry/FloatRoundedRect.h"
#include "platform/geometry/FloatSize.h"
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/WindRule.h"
@@ -100,7 +100,7 @@ static inline FloatSize physicalSizeToLogical(const FloatSize& size, WritingMode
return size.transposedSize();
}
-static inline void ensureRadiiDoNotOverlap(FloatRect &bounds, FloatSize &radii)
+static inline void ensureRadiiDoNotOverlap(FloatRect& bounds, FloatSize& radii)
{
float widthRatio = bounds.width() / (2 * radii.width());
float heightRatio = bounds.height() / (2 * radii.height());
@@ -241,6 +241,8 @@ PassOwnPtr<Shape> Shape::createShape(const BasicShape* basicShape, const LayoutS
floatSizeForLengthSize(inset.bottomLeftRadius(), boxSize),
floatSizeForLengthSize(inset.bottomRightRadius(), boxSize));
+ cornerRadii.scale(calcBorderRadiiConstraintScaleFor(logicalRect, cornerRadii));
+
shape = createInsetShape(FloatRoundedRect(logicalRect, cornerRadii));
break;
}

Powered by Google App Engine
This is Rietveld 408576698