mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 08:27:45 +00:00
Can now click empty lines in Script Editor
(accounted for empty trailing lines)
This commit is contained in:
1 parent
31ea784998
commit
c062c1340b
2 files changed
+9
-3
No files matched your search
@@ -249,7 +249,13 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
lineWidth = w;
|
||||
}
|
||||
|
||||
return data.end - 1;
|
||||
// Place cursor after the last visible character of the line.
|
||||
// `data.end - 1` previously pointed at the newline for non-last lines
|
||||
// which made clicks land on the newline rather than after the text.
|
||||
// Use data.start + chars.length to return the position directly
|
||||
// after the line's characters, clamped to the total text length.
|
||||
int posAfterChars = data.start + chars.length;
|
||||
return Math.min(posAfterChars, text.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user