1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-29 23:58:34 +01:00

Compare commits

..

No commits in common. "f6beaff43a3083c7f8d9350cbca3877e2920681b" and "7b2306f58f5270bcd346636b54130597f09c521b" have entirely different histories.

2 changed files with 9 additions and 27 deletions

View file

@ -12,15 +12,9 @@ Jump to version:
## 6.2.0 (In Development) ## 6.2.0 (In Development)
### MLEM
Fixes
- Fixed control characters being included in TextInput
### MLEM.Ui ### MLEM.Ui
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 a multiline text field's cursor not returning to the default position when the last character is removed
## 6.1.0 ## 6.1.0

View file

@ -415,20 +415,16 @@ namespace MLEM.Input {
} }
private bool FilterText(ref string text, bool removeMismatching) { private bool FilterText(ref string text, bool removeMismatching) {
var result = new StringBuilder(); if (removeMismatching) {
foreach (var codePoint in new CodePointSource(text)) { var result = new StringBuilder();
var character = char.ConvertFromUtf32(codePoint); foreach (var codePoint in new CodePointSource(text)) {
// don't include control characters var character = char.ConvertFromUtf32(codePoint);
if (character.Length == 1 && char.IsControl(character, 0)) if (this.InputRule(this, character))
continue; result.Append(character);
if (this.InputRule(this, character)) {
result.Append(character);
} else if (!removeMismatching) {
// if we don't remove mismatching characters, we just fail
return false;
} }
} text = result.ToString();
text = result.ToString(); } else if (!this.InputRule(this, text))
return false;
return true; return true;
} }
@ -512,14 +508,6 @@ 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++) {