From a47d3f50cb33e87582d3481128354d2588d25323 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 17 Feb 2023 13:16:49 +0100 Subject: [PATCH] Fixed TextInputs behaving incorrectly when switching between multiline and single-line modes --- CHANGELOG.md | 1 + MLEM/Input/TextInput.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e88510..de158e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Jump to version: ### MLEM Fixes - Fixed control characters being included in TextInput +- Fixed TextInputs behaving incorrectly when switching between multiline and single-line modes ### MLEM.Ui Fixes diff --git a/MLEM/Input/TextInput.cs b/MLEM/Input/TextInput.cs index 464835d..ec3538f 100644 --- a/MLEM/Input/TextInput.cs +++ b/MLEM/Input/TextInput.cs @@ -485,6 +485,8 @@ namespace MLEM.Input { this.textOffset = 0; } } else { + this.splitText = null; + this.lineOffset = 0; // not multiline, so scroll horizontally based on caret position if (this.Font.MeasureString(this.text).X * this.TextScale > this.Size.X) { if (this.textOffset > this.CaretPos) {