From f95c8890c153f129f78c66107cfe11726f2e9b82 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 10 Jan 2018 10:32:24 -0800 Subject: [PATCH] libtxt: map pixel coordinates above the text to glyph positions on the first line of text (flutter/engine#4533) This matches Blink's behavior --- engine/src/flutter/third_party/txt/src/txt/paragraph.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc index 573f25b63a..a91aeadfa6 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc +++ b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc @@ -955,7 +955,7 @@ std::vector Paragraph::GetRectsForRange(size_t start, Paragraph::PositionWithAffinity Paragraph::GetGlyphPositionAtCoordinate( double dx, double dy) const { - if (line_heights_.empty() || dy < 0) + if (line_heights_.empty()) return PositionWithAffinity(0, DOWNSTREAM); size_t y_index;