- pango_layout_get_cursor_pos (line_display->layout, index, &strong_pos, &weak_pos);
-
- cursor_location.x = line_display->x_offset + PANGO_PIXELS (strong_pos.x);
- cursor_location.y = line_display->top_margin + PANGO_PIXELS (strong_pos.y);
- cursor_location.width = 0;
- cursor_location.height = PANGO_PIXELS (strong_pos.height);
-
- if (layout->cursor_direction == GTK_TEXT_DIR_NONE ||
- line_display->direction == layout->cursor_direction)
- {
- gtk_draw_insertion_cursor (widget, cr,
- &cursor_location, TRUE, line_display->direction,
- layout->cursor_direction != GTK_TEXT_DIR_NONE);
- }
-
- if ((strong_pos.x != weak_pos.x || strong_pos.y != weak_pos.y) &&
- (layout->cursor_direction == GTK_TEXT_DIR_NONE ||
- line_display->direction != layout->cursor_direction))
- {
- GtkTextDirection dir;
-
- dir = (line_display->direction == GTK_TEXT_DIR_RTL) ? GTK_TEXT_DIR_LTR : GTK_TEXT_DIR_RTL;
-
- cursor_location.x = line_display->x_offset + PANGO_PIXELS (weak_pos.x);
- cursor_location.y = line_display->top_margin + PANGO_PIXELS (weak_pos.y);
- cursor_location.width = 0;
- cursor_location.height = PANGO_PIXELS (weak_pos.height);
-
- gtk_draw_insertion_cursor (widget, cr,
- &cursor_location, FALSE, dir,
- TRUE);
- }
+ dir = (line_display->direction == GTK_TEXT_DIR_RTL) ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR;
+ gtk_render_insertion_cursor (context, cr,
+ line_display->x_offset, line_display->top_margin,
+ line_display->layout, index, dir);