mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add textbox:indexByPos and :lineY methods
This commit is contained in:
parent
1e16ab5464
commit
65b4ac8262
5 changed files with 38 additions and 3 deletions
|
|
@ -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 == '_') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue