mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 16:37:45 +00:00
Highlighted current line the text cursor is on
This commit is contained in:
1 parent
2f6e8b9408
commit
395ed1dc4a
1 file changed
+5
@@ -149,6 +149,11 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Highlight the current line (light gray) under any selection
|
||||
if (active && isEnabled() && (cursorPosition >= data.start && cursorPosition < data.end || (i == list.size() - 1 && cursorPosition == text.length()))) {
|
||||
int lineY = y + 1 + (i - scrolledLine) * container.lineHeight;
|
||||
drawRect(x + 1, lineY, x + width - 1, lineY + container.lineHeight, 0x22e0e0e0);
|
||||
}
|
||||
if (startSelection != endSelection && endSelection > data.start && startSelection <= data.end) {
|
||||
if (startSelection < data.end) {
|
||||
int s = ClientProxy.Font.width(line.substring(0, Math.max(startSelection - data.start, 0)));
|
||||
|
||||
Reference in new issue
Block a user