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

Unified Diff: Source/core/rendering/ExclusionPolygon.cpp

Issue 14289003: [CSS Exclusions] Zoom causes shape-inside to fail when shape-padding is specified (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Sync Created 7 years, 8 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 | « LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-zoom-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/ExclusionPolygon.cpp
diff --git a/Source/core/rendering/ExclusionPolygon.cpp b/Source/core/rendering/ExclusionPolygon.cpp
index 136287ac40f54a90d70754c8defa857add7cc4cd..b3d5884bfcd2575d1501391c5141357e0b1bdd03 100644
--- a/Source/core/rendering/ExclusionPolygon.cpp
+++ b/Source/core/rendering/ExclusionPolygon.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "ExclusionPolygon.h"
+#include "LayoutPoint.h"
#include <wtf/MathExtras.h>
@@ -129,6 +130,12 @@ static inline void appendArc(Vector<FloatPoint>& vertices, const FloatPoint& arc
vertices.append(endArcVertex);
}
+static inline void snapVerticesToLayoutUnitGrid(Vector<FloatPoint>& vertices)
+{
+ for (unsigned i = 0; i < vertices.size(); ++i)
+ vertices[i] = flooredLayoutPoint(vertices[i]);
+}
+
static inline FloatPolygon* computeShapePaddingBounds(const FloatPolygon& polygon, float padding, WindRule fillRule)
{
Vector<FloatPoint>* paddedVertices = new Vector<FloatPoint>();
@@ -146,6 +153,7 @@ static inline FloatPolygon* computeShapePaddingBounds(const FloatPolygon& polygo
appendArc(*paddedVertices, thisEdge.vertex1(), padding, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), true);
}
+ snapVerticesToLayoutUnitGrid(*paddedVertices);
return new FloatPolygon(adoptPtr(paddedVertices), fillRule);
}
@@ -166,6 +174,7 @@ static inline FloatPolygon* computeShapeMarginBounds(const FloatPolygon& polygon
appendArc(*marginVertices, thisEdge.vertex1(), margin, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), false);
}
+ snapVerticesToLayoutUnitGrid(*marginVertices);
return new FloatPolygon(adoptPtr(marginVertices), fillRule);
}
« no previous file with comments | « LayoutTests/fast/exclusions/shape-inside/shape-inside-polygon-zoom-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698