Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Unified Diff: Source/core/layout/svg/LayoutSVGInlineText.cpp

Issue 1072403007: Fixup a bug about SVG text selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add test Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/layout/svg/LayoutSVGInlineText.cpp
diff --git a/Source/core/layout/svg/LayoutSVGInlineText.cpp b/Source/core/layout/svg/LayoutSVGInlineText.cpp
index 69553b53f7abf9be827f39d611b7d3ff8fb6bca5..c7ee7be1498ce4b4cb6ed495a2fda79d181700b4 100644
--- a/Source/core/layout/svg/LayoutSVGInlineText.cpp
+++ b/Source/core/layout/svg/LayoutSVGInlineText.cpp
@@ -184,7 +184,7 @@ PositionWithAffinity LayoutSVGInlineText::positionForPoint(const LayoutPoint& po
fragment.buildFragmentTransform(fragmentTransform);
fragmentRect = fragmentTransform.mapRect(fragmentRect);
- float distance = powf(fragmentRect.x() - absolutePoint.x(), 2) +
+ float distance = powf(fragmentRect.x() + fragmentRect.width() / 2 - absolutePoint.x(), 2) +
fs 2015/04/21 10:46:20 Looks like this could now be: float distance = (f
powf(fragmentRect.y() + fragmentRect.height() / 2 - absolutePoint.y(), 2);
if (distance < closestDistance) {

Powered by Google App Engine
This is Rietveld 408576698