| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "core/layout/svg/SVGLayoutSupport.h" | 22 #include "core/layout/svg/SVGLayoutSupport.h" |
| 23 #include "core/svg/SVGPathElement.h" | 23 #include "core/svg/SVGPathElement.h" |
| 24 #include "core/svg/SVGTextPathElement.h" | 24 #include "core/svg/SVGTextPathElement.h" |
| 25 #include "platform/graphics/Path.h" | 25 #include "platform/graphics/Path.h" |
| 26 | 26 |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 TreeScope& treeScopeForIdResolution(const SVGElement& element) | 29 TreeScope& treeScopeForIdResolution(const SVGElement& element) |
| 30 { | 30 { |
| 31 if (SVGElement* correspondingElement = element.correspondingElement()) | 31 if (SVGElement* correspondingElement = element.correspondingElement()) |
| 32 return correspondingElement->treeScope(); | 32 return correspondingElement->treeScopeOrDocument(); |
| 33 return element.treeScope(); | 33 return element.treeScopeOrDocument(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 PathPositionMapper::PathPositionMapper(const Path& path) | 36 PathPositionMapper::PathPositionMapper(const Path& path) |
| 37 : m_positionCalculator(path) | 37 : m_positionCalculator(path) |
| 38 , m_pathLength(path.length()) | 38 , m_pathLength(path.length()) |
| 39 { | 39 { |
| 40 } | 40 } |
| 41 | 41 |
| 42 PathPositionMapper::PositionType PathPositionMapper::pointAndNormalAtLength( | 42 PathPositionMapper::PositionType PathPositionMapper::pointAndNormalAtLength( |
| 43 float length, FloatPoint& point, float& angle) | 43 float length, FloatPoint& point, float& angle) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 { | 92 { |
| 93 const SVGLength& startOffset = *toSVGTextPathElement(node())->startOffset()-
>currentValue(); | 93 const SVGLength& startOffset = *toSVGTextPathElement(node())->startOffset()-
>currentValue(); |
| 94 float textPathStartOffset = startOffset.valueAsPercentage(); | 94 float textPathStartOffset = startOffset.valueAsPercentage(); |
| 95 if (startOffset.typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Perce
ntage) | 95 if (startOffset.typeWithCalcResolved() == CSSPrimitiveValue::UnitType::Perce
ntage) |
| 96 textPathStartOffset *= pathLength; | 96 textPathStartOffset *= pathLength; |
| 97 | 97 |
| 98 return textPathStartOffset; | 98 return textPathStartOffset; |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |