* 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 Index of the character position or -1 if there is no character at the position. */
| 439 | * @return Index of the character position or -1 if there is no character at the position. |
| 440 | */ |
| 441 | ptrdiff_t GetCharAtPosition(std::string_view str, int x, FontSize start_fontsize) |
| 442 | { |
| 443 | if (x < 0) return -1; |
| 444 | |
| 445 | Layouter layout(str, INT32_MAX, start_fontsize); |
| 446 | return layout.GetCharAtPosition(x, 0); |
| 447 | } |
no test coverage detected