fix: console/chat open still available when menu is open & cleanup

This commit is contained in:
MihailRis
2025-02-16 00:38:33 +03:00
parent 31d5cb6880
commit c7061c70cb
3 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -408,7 +408,9 @@ void TextBox::refresh() {
Container::refresh();
label->setSize(size-glm::vec2(padding.z+padding.x, padding.w+padding.y));
label->setPos(glm::vec2(
padding.x + LINE_NUMBERS_PANE_WIDTH * showLineNumbers + textInitX - static_cast<int>(textOffset), padding.y
padding.x + LINE_NUMBERS_PANE_WIDTH * showLineNumbers + textInitX -
static_cast<int>(textOffset),
padding.y
));
}
@@ -815,8 +817,8 @@ size_t TextBox::getCaret() const {
return caret;
}
void TextBox::setCaret(size_t position, bool ignoreFormatting) {
const auto& labelText = ignoreFormatting ? label->getText() : input;
void TextBox::setCaret(size_t position) {
const auto& labelText = label->getText();
caret = std::min(static_cast<size_t>(position), input.length());
if (font == nullptr) {
return;