add textbox:indexByPos and :lineY methods

This commit is contained in:
MihailRis
2025-11-14 23:48:02 +03:00
parent 1e16ab5464
commit 65b4ac8262
5 changed files with 38 additions and 3 deletions
+5
View File
@@ -671,6 +671,11 @@ int TextBox::calcIndexAt(int x, int y) const {
);
}
int TextBox::getLineYOffset(int line) const {
if (rawTextCache.fontId == 0) return 0;
return label->getLineYOffset(line) + getContentOffset().y;
}
static inline std::wstring get_alphabet(wchar_t c) {
std::wstring alphabet {c};
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') {