[pango/ligature-caret-rtl-fixes: 2/7] Fixes for rtl cursor positions




commit 8832d54c53e14cda73cbf88c376917e2e513a889
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 27 00:54:43 2021 -0400

    Fixes for rtl cursor positions
    
    Still not working quite right, but getting closer.

 pango/glyphstring.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/pango/glyphstring.c b/pango/glyphstring.c
index 8d4aa604..74462d26 100644
--- a/pango/glyphstring.c
+++ b/pango/glyphstring.c
@@ -534,7 +534,10 @@ pango_glyph_string_index_to_x (PangoGlyphString *glyphs,
                                         cluster_offset - 1, &caret_count, &caret);
       if (caret_count > 0)
         {
-          *x_pos = start_xpos + caret;
+          if (analysis->level % 2) /* Right to left */
+            *x_pos = end_xpos + caret;
+          else
+            *x_pos = start_xpos + caret;
           return;
         }
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]