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

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

Issue 208423003: [CSS Shapes] clamp RasterShape shapeMargin to reference box size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix sqrt problem 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
« no previous file with comments | « Source/core/rendering/shapes/RasterShape.h ('k') | Source/core/rendering/shapes/Shape.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/RasterShape.cpp
diff --git a/Source/core/rendering/shapes/RasterShape.cpp b/Source/core/rendering/shapes/RasterShape.cpp
index 996a8b8625ae26012a68583461ec5425aa72ee09..da08eedb651c0113b8cd19d7faf1156f465c6392 100644
--- a/Source/core/rendering/shapes/RasterShape.cpp
+++ b/Source/core/rendering/shapes/RasterShape.cpp
@@ -255,11 +255,10 @@ const RasterShapeIntervals& RasterShape::marginIntervals() const
if (!shapeMargin())
return *m_intervals;
- int marginBoundaryRadius = std::min(clampToInteger(ceil(shapeMargin())), std::max(m_imageSize.width(), m_imageSize.height()));
- if (!m_marginIntervals) {
- ASSERT(marginBoundaryRadius >= 0);
- m_marginIntervals = m_intervals->computeShapeMarginIntervals(marginBoundaryRadius);
- }
+ int shapeMarginInt = clampToPositiveInteger(ceil(shapeMargin()));
+ int maxShapeMarginInt = std::max(m_marginRectSize.width(), m_marginRectSize.height()) * sqrtf(2);
+ if (!m_marginIntervals)
+ m_marginIntervals = m_intervals->computeShapeMarginIntervals(std::min(shapeMarginInt, maxShapeMarginInt));
return *m_marginIntervals;
}
« no previous file with comments | « Source/core/rendering/shapes/RasterShape.h ('k') | Source/core/rendering/shapes/Shape.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698