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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h

Issue 2539763002: Use the right point for marker orientation when closing a subpath (Closed)
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/LayoutTests/svg/markers/marker-orientation-close-path-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h b/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
index 20527e24b7041c21c56f2aac63ba1219d957010a..4dcb7005afc01bd2700199dae89d3ef62bb9c148 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
+++ b/third_party/WebKit/Source/core/layout/svg/SVGMarkerData.h
@@ -106,14 +106,17 @@ class SVGMarkerData {
return 0;
}
- void updateOutslope(const FloatPoint& point) {
+ void updateOutslope(const PathElement& element) {
m_outslopePoints[0] = m_origin;
+ FloatPoint point = element.type == PathElementCloseSubpath
+ ? m_subpathStart
+ : element.points[0];
m_outslopePoints[1] = point;
}
void updateFromPathElement(const PathElement& element) {
// First update the outslope for the previous element.
- updateOutslope(element.points[0]);
+ updateOutslope(element);
// Record the marker for the previous element.
if (m_elementIndex > 0) {
@@ -148,7 +151,7 @@ class SVGMarkerData {
m_origin = points[0];
break;
case PathElementCloseSubpath:
- updateInslope(points[0]);
+ updateInslope(m_subpathStart);
m_origin = m_subpathStart;
m_subpathStart = FloatPoint();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/markers/marker-orientation-close-path-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698