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 point 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> <li>ERROR_NULL_ARGUMENT - if the point is null</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)
    class TextLayout
    int
    getOffset
  2. int getOffset(int x, int y, int[] trailing)

Meta