TextLayout.getOffset

Returns the character offset for the specified point. For a typical character, the trailing argument will be filled in to indicate whether the point is closer to the leading edge (0) or the trailing edge (1). When the point is over a cluster composed of multiple characters, the trailing argument will be filled with the position of the character in the cluster that is closest to the point.

@param x the x coordinate of the point @param y the y coordinate of the point @param trailing the trailing buffer @return the character offset

@exception IllegalArgumentException <ul> <li>ERROR_INVALID_ARGUMENT - if the trailing length is less than <code>1</code></li> </ul> @exception SWTException <ul> <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> </ul>

@see #getLocation(int, bool)

  1. int getOffset(Point point, int[] trailing)
  2. int getOffset(int x, int y, int[] trailing)
    class TextLayout
    int
    getOffset
    (
    int x
    ,
    int y
    ,
    int[] trailing
    )

Meta