Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
GTK2
GTK2.Pango.Layout

Method GTK2.Pango.Layout()->xy_to_index()


Method xy_to_index

mapping xy_to_index(int x, int y)

Description

Converts from x and y position within a layout to the byte index to the character at that logical position. If the y position is not inside the layout, the closest position is chosen (the position will be clamped inside the layout). If the X position is not within the layout, then the start or the end of the line is chosen as describe for x_to_index(). If either the x or y positions were not inside the layout, then returns 0.

Returns: ([ "index": byte index, "trailing": where in grapheme user clicked ]).