diff --git a/txt/src/txt/paragraph_txt.cc b/txt/src/txt/paragraph_txt.cc index 9969aa3524f44fb9936c36b28cea72a367e75faf..33af8c9e206dd32df69e5eb6dd615fee6bae7b8f 100644 --- a/txt/src/txt/paragraph_txt.cc +++ b/txt/src/txt/paragraph_txt.cc @@ -2353,7 +2353,7 @@ Paragraph::PositionWithAffinity ParagraphTxt::GetGlyphPositionAtCoordinate( } } - double glyph_center = (gp->x_pos.start + gp->x_pos.end) * paragraph_style_.text_split_ratio; + double glyph_center = (gp->x_pos.end - gp->x_pos.start) * paragraph_style_.text_split_ratio + gp->x_pos.start; if ((direction == TextDirection::ltr && dx < glyph_center) || (direction == TextDirection::rtl && dx >= glyph_center)) { return PositionWithAffinity(gp->code_units.start, DOWNSTREAM);