From 71f8ea34ebc5d7bcc96c88f986d8667c447cc8fe Mon Sep 17 00:00:00 2001 From: ethanwei Date: Wed, 27 Dec 2023 17:00:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=BE=93=E5=85=A5=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=9C=AB=E5=B0=BE=E7=A9=BA=E7=99=BD=E5=A4=84?= =?UTF-8?q?=EF=BC=8C=E5=85=89=E6=A0=87=E6=97=A0=E6=B3=95=E7=A7=BB=E5=88=B0?= =?UTF-8?q?=E6=9C=AB=E5=B0=BE=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ethanwei Change-Id: Iec563da515c4a579ae9dc5b718da18feee91de4a --- txt/src/txt/paragraph_txt.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/txt/src/txt/paragraph_txt.cc b/txt/src/txt/paragraph_txt.cc index 9969aa35..33af8c9e 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); -- Gitee