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..d8bfd6a408c270f38a93d16bd8edddc241a25c1a 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.cpp |
@@ -59,7 +59,17 @@ Path LayoutSVGTextPath::layoutPath() const |
float LayoutSVGTextPath::startOffset() const |
{ |
- return toSVGTextPathElement(node())->startOffset()->currentValue()->valueAsPercentage(); |
+ float textPathStartOffset = toSVGTextPathElement(node())->startOffset()->currentValue()->valueAsPercentage(); |
+ if (isPercentageForStartOffset()) { |
+ if (textPathStartOffset > 0 && textPathStartOffset <= 1) |
fs
2016/01/28 14:00:20
This condition does not do anything useful. The sp
|
+ textPathStartOffset *= layoutPath().length(); |
fs
2016/01/28 14:00:20
We don't want to call layoutPath() again here - an
|
+ } |
+ return textPathStartOffset; |
+} |
+ |
+bool LayoutSVGTextPath::isPercentageForStartOffset() const |
fs
2016/01/28 14:00:20
Don't need this method - just inline this check in
|
+{ |
+ return toSVGTextPathElement(node())->startOffset()->currentValue()->isPercentage(); |
} |
} // namespace blink |