diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/Path.cpp')
| -rw-r--r-- | Source/WebCore/platform/graphics/Path.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/Path.cpp b/Source/WebCore/platform/graphics/Path.cpp index 55760b1..f7aedbe 100644 --- a/Source/WebCore/platform/graphics/Path.cpp +++ b/Source/WebCore/platform/graphics/Path.cpp @@ -83,14 +83,14 @@ static void pathLengthApplierFunction(void* info, const PathElement* element) } } -float Path::length() +float Path::length() const { PathTraversalState traversalState(PathTraversalState::TraversalTotalLength); apply(&traversalState, pathLengthApplierFunction); return traversalState.m_totalLength; } -FloatPoint Path::pointAtLength(float length, bool& ok) +FloatPoint Path::pointAtLength(float length, bool& ok) const { PathTraversalState traversalState(PathTraversalState::TraversalPointAtLength); traversalState.m_desiredLength = length; @@ -99,10 +99,10 @@ FloatPoint Path::pointAtLength(float length, bool& ok) return traversalState.m_current; } -float Path::normalAngleAtLength(float length, bool& ok) +float Path::normalAngleAtLength(float length, bool& ok) const { PathTraversalState traversalState(PathTraversalState::TraversalNormalAngleAtLength); - traversalState.m_desiredLength = length; + traversalState.m_desiredLength = length ? length : std::numeric_limits<float>::epsilon(); apply(&traversalState, pathLengthApplierFunction); ok = traversalState.m_success; return traversalState.m_normalAngle; |
