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

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

Issue 2567853002: Clarify how LayoutSVGResourceMarker's m_viewport interacts with refX/refY (Closed)
Patch Set: Created 4 years 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/Source/core/layout/svg/LayoutSVGResourceMarker.h ('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/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 e092528cb108062186336895a4b6e53564cd5330..b3141128174524e901768d817c32d7b5686d91f6 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp
@@ -73,8 +73,7 @@ FloatRect LayoutSVGResourceMarker::markerBoundaries(
}
AffineTransform LayoutSVGResourceMarker::localToSVGParentTransform() const {
- return AffineTransform::translation(m_viewport.x(), m_viewport.y()) *
- viewportTransform();
+ return viewportTransform();
}
FloatPoint LayoutSVGResourceMarker::referencePoint() const {
@@ -117,8 +116,8 @@ AffineTransform LayoutSVGResourceMarker::markerTransformation(
transform.rotate(orientType() == SVGMarkerOrientAngle ? angle() : autoAngle);
transform.scale(markerScale);
- // The 'origin' coordinate maps to SVGs refX/refY, given in coordinates
- // relative to the viewport established by the marker.
+ // The reference point (refX, refY) is in the coordinate space of the marker's
+ // contents so we include the value in each marker's transform.
FloatPoint mappedReferencePoint =
viewportTransform().mapPoint(referencePoint());
transform.translate(-mappedReferencePoint.x(), -mappedReferencePoint.y());
@@ -138,8 +137,8 @@ AffineTransform LayoutSVGResourceMarker::viewportTransform() const {
SVGMarkerElement* marker = toSVGMarkerElement(element());
ASSERT(marker);
- return marker->viewBoxToViewTransform(m_viewport.width(),
- m_viewport.height());
+ return marker->viewBoxToViewTransform(m_viewportSize.width(),
+ m_viewportSize.height());
}
void LayoutSVGResourceMarker::calcViewport() {
@@ -150,9 +149,9 @@ void LayoutSVGResourceMarker::calcViewport() {
ASSERT(marker);
SVGLengthContext lengthContext(marker);
- float w = marker->markerWidth()->currentValue()->value(lengthContext);
- float h = marker->markerHeight()->currentValue()->value(lengthContext);
- m_viewport = FloatRect(0, 0, w, h);
+ float width = marker->markerWidth()->currentValue()->value(lengthContext);
+ float height = marker->markerHeight()->currentValue()->value(lengthContext);
+ m_viewportSize = FloatSize(width, height);
}
SVGTransformChange LayoutSVGResourceMarker::calculateLocalTransform() {
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698