mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-10-31 21:00:51 +01:00
Fixed a multiline text field's cursor not returning to the default position when the last character is removed
This commit is contained in:
parent
aef6f7bd58
commit
f6beaff43a
2 changed files with 9 additions and 0 deletions
|
@ -20,6 +20,7 @@ Fixes
|
||||||
Fixes
|
Fixes
|
||||||
- Fixed images not updating their hidden state properly when the displayed texture changes
|
- Fixed images not updating their hidden state properly when the displayed texture changes
|
||||||
- Fixed control characters being included in TextField
|
- Fixed control characters being included in TextField
|
||||||
|
- Fixed a multiline text field's cursor not returning to the default position when the last character is removed
|
||||||
|
|
||||||
## 6.1.0
|
## 6.1.0
|
||||||
|
|
||||||
|
|
|
@ -512,6 +512,14 @@ namespace MLEM.Input {
|
||||||
|
|
||||||
private void UpdateCaretData() {
|
private void UpdateCaretData() {
|
||||||
if (this.splitText != null) {
|
if (this.splitText != null) {
|
||||||
|
// the code below will never execute if our text is empty, so reset our caret position fully
|
||||||
|
if (this.splitText.Length <= 0) {
|
||||||
|
this.caretLine = 0;
|
||||||
|
this.caretPosInLine = 0;
|
||||||
|
this.caretDrawOffset = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var line = 0;
|
var line = 0;
|
||||||
var index = 0;
|
var index = 0;
|
||||||
for (var d = 0; d < this.splitText.Length; d++) {
|
for (var d = 0; d < this.splitText.Length; d++) {
|
||||||
|
|
Loading…
Reference in a new issue