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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp

Issue 1916173003: Don't use a magic value for 'auto' oriented <marker>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp
index 5d1cc7d6340d3ec764c499cbc1591c441a7be689..11cf345ab6bba5d210856d8b5df1a00a19d80e6a 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp
@@ -90,13 +90,7 @@ FloatPoint LayoutSVGResourceMarker::referencePoint() const
float LayoutSVGResourceMarker::angle() const
{
- ASSERT(element());
-
- float angle = -1;
- if (orientType() == SVGMarkerOrientAngle)
- angle = toSVGMarkerElement(*element()).orientAngle()->currentValue()->value();
-
- return angle;
+ return toSVGMarkerElement(element())->orientAngle()->currentValue()->value();
}
SVGMarkerUnitsType LayoutSVGResourceMarker::markerUnits() const
@@ -111,12 +105,11 @@ SVGMarkerOrientType LayoutSVGResourceMarker::orientType() const
AffineTransform LayoutSVGResourceMarker::markerTransformation(const FloatPoint& origin, float autoAngle, float strokeWidth) const
{
- float markerAngle = angle();
bool useStrokeWidth = markerUnits() == SVGMarkerUnitsStrokeWidth;
AffineTransform transform;
transform.translate(origin.x(), origin.y());
- transform.rotate(markerAngle == -1 ? autoAngle : markerAngle);
+ transform.rotate(orientType() == SVGMarkerOrientAngle ? angle() : autoAngle);
transform = markerContentTransformation(transform, referencePoint(), useStrokeWidth ? strokeWidth : -1);
return transform;
}

Powered by Google App Engine
This is Rietveld 408576698