From a1f0c2c2527b91d3a1d4f47eb2c043ebdef60119 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 14 Oct 2025 21:44:14 +0300 Subject: [PATCH] fix mouse click textbox caret set --- src/graphics/ui/elements/TextBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/ui/elements/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp index 81732348..c9afde7f 100644 --- a/src/graphics/ui/elements/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -661,7 +661,7 @@ int TextBox::calcIndexAt(int x, int y) const { line = std::min(line, label->getLinesNumber() - 1); size_t lineLength = getLineLength(line); uint offset = 0; - while (lcoord.x + rawTextCache.metrics.calcWidth(labelText, offset) < x && + while (lcoord.x + rawTextCache.metrics.calcWidth(labelText, 0, offset) < x && offset < lineLength - 1) { offset++; }