Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp |
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp |
index 5243c2c1f326fefff3300ba8d7b4679b951cb57f..5c1719aa964e02a0943b6fcfa4f5ff03ab67ac2a 100644 |
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp |
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp |
@@ -58,14 +58,6 @@ static PassRefPtr<StringImpl> applySVGWhitespaceRules(PassRefPtr<StringImpl> str |
return newString.release(); |
} |
-static float squaredDistanceToClosestPoint(const FloatRect& rect, const FloatPoint& point) |
-{ |
- FloatPoint closestPoint; |
- closestPoint.setX(std::max(std::min(point.x(), rect.maxX()), rect.x())); |
- closestPoint.setY(std::max(std::min(point.y(), rect.maxY()), rect.y())); |
- return (point - closestPoint).diagonalLengthSquared(); |
-} |
- |
LayoutSVGInlineText::LayoutSVGInlineText(Node* n, PassRefPtr<StringImpl> string) |
: LayoutText(n, applySVGWhitespaceRules(string, false)) |
, m_scalingFactor(1) |
@@ -187,7 +179,7 @@ PositionWithAffinity LayoutSVGInlineText::positionForPoint(const LayoutPoint& po |
float distance = 0; |
if (!fragmentRect.contains(absolutePoint)) |
- distance = squaredDistanceToClosestPoint(fragmentRect, absolutePoint); |
+ distance = fragmentRect.squaredDistanceTo(absolutePoint); |
if (distance <= closestDistance) { |
closestDistance = distance; |