Refined text cursor rendering

This commit is contained in:
bigguy345 committed 2025-12-18 10:32:25 +02:00
1 parent 10d6d0c408
commit 1ab26a9e84
1 file changed
+2 -2
@@ -236,10 +236,10 @@ public class GuiScriptTextArea extends GuiNpcTextField {
data.drawString(x + 1, yPos, 0xFFe0e0e0);
// Draw cursor
if (active && isEnabled() && (cursorCounter / 6) % 2 == 0 && (cursorPosition >= data.start && cursorPosition < data.end || (i == list.size() - 1 && cursorPosition == text.length()))) {
if (active && isEnabled() && (cursorCounter / 10) % 2 == 0 && (cursorPosition >= data.start && cursorPosition < data.end || (i == list.size() - 1 && cursorPosition == text.length()))) {
int posX = x + ClientProxy.Font.width(
line.substring(0, Math.min(cursorPosition - data.start, line.length())));
drawRect(posX + 1, yPos, posX + 2, yPos + 1 + container.lineHeight, -3092272);
drawRect(posX + 1, yPos, posX + 2, yPos - 2 + container.lineHeight, 0xffffffff);
}
}
}