Use pango api better
authorMatthias Clasen <mclasen@redhat.com>
Sun, 23 Jan 2022 14:09:57 +0000 (09:09 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 23 Jan 2022 14:09:57 +0000 (09:09 -0500)
Avoid direct access to PangoLayoutLine members,
use pango api for it where we can.

gtk/gtklabel.c

index 5def4168b69d84c25cb42c0e7c20272e560f709a..7560e551fe4462ba29662a9626b3f83190654489 100644 (file)
@@ -899,8 +899,8 @@ get_cursor_direction (GtkLabel *self)
        * definitely in this paragraph, which is good enough
        * to figure out the resolved direction.
        */
-       if (line->start_index + line->length >= self->select_info->selection_end)
-        return line->resolved_dir;
+       if (pango_layout_line_get_start_index (line) + pango_layout_line_get_length (line) >= self->select_info->selection_end)
+        return pango_layout_line_get_resolved_direction (line);
     }
 
   return PANGO_DIRECTION_LTR;