[pango/block-cursor-fixes: 4/4] layout: Fix some wrapped line start positions




commit a1b49a7dc93d8e75af600bce27fa4edcc5961513
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Aug 20 02:07:53 2021 -0400

    layout: Fix some wrapped line start positions
    
    Make pango_layout_index_to_pos report non-empty
    pos for the first position in a wrapped line.

 pango/pango-layout.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 5ae46f85..669410ee 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2425,7 +2425,8 @@ pango_layout_index_to_pos (PangoLayout    *layout,
                  }
                while (pango_layout_iter_next_run (&iter));
 
-              break;
+              if (layout_line->start_index + layout_line->length > index)
+                break;
             }
 
           if (!pango_layout_iter_next_line (&iter))


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