[gtk/sloped-caret: 2/2] Use pango_layout_get_caret_pos




commit ca7812baae4a79d175dc6929ba331e47da5f7c08
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Aug 24 16:49:30 2021 -0400

    Use pango_layout_get_caret_pos
    
    This new api returns rectangles for sloped carets,
    in contrast to pango_layout_get_cursor_pos, which
    always returns a rectangle with a width of zero.

 gtk/gtkstylecontext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 2642106bf0..864ee19da1 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -1166,7 +1166,7 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
         keyboard_direction = gdk_device_get_direction (keyboard);
     }
 
-  pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);
+  pango_layout_get_caret_pos (layout, index, &strong_pos, &weak_pos);
 
   direction2 = PANGO_DIRECTION_NEUTRAL;
 


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