Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp |
index a243f639f86a085e3d5f00604ec89c8fbf8dde30..7c58292841dec5e6d864a2e94917f164d79eea40 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp |
@@ -57,9 +57,14 @@ Path LayoutSVGTextPath::layoutPath() const |
return pathData; |
} |
-float LayoutSVGTextPath::startOffset() const |
+float LayoutSVGTextPath::calculateStartOffset(float pathLength) const |
{ |
- return toSVGTextPathElement(node())->startOffset()->currentValue()->valueAsPercentage(); |
+ const SVGLength& startOffset = *toSVGTextPathElement(node())->startOffset()->currentValue(); |
+ float textPathStartOffset = startOffset.valueAsPercentage(); |
+ if (startOffset.typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Percentage) { |
+ textPathStartOffset *= pathLength; |
+ } |
fs
2016/01/28 15:50:39
Nit: Remove { }
|
+ return textPathStartOffset; |
} |
} // namespace blink |