(svn r25691) -Add: [OSX] Support for mouse selection in the IME composition string.

This commit is contained in:
michi_cc
2013-08-05 20:37:53 +00:00
parent 4dbe823a5f
commit e34fe220e2
10 changed files with 129 additions and 2 deletions

View File

@@ -721,6 +721,21 @@ Point GetCharPosInString(const char *str, const char *ch, FontSize start_fontsiz
return layout.GetCharPosition(ch);
}
/**
* Get the character from a string that is drawn at a specific position.
* @param str String to test.
* @param x Position relative to the start of the string.
* @param start_fontsize Font size to start the text with.
* @return Pointer to the character at the position or NULL if there is no character at the position.
*/
const char *GetCharAtPosition(const char *str, int x, FontSize start_fontsize)
{
if (x < 0) return NULL;
Layouter layout(str, INT32_MAX, TC_FROMSTRING, start_fontsize);
return layout.GetCharAtPosition(x);
}
/**
* Draw single character horizontally centered around (x,y)
* @param c Character (glyph) to draw