From 3b5d54dd9684e3a2e5a3c87d148c5ae729724626 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 10 Jan 2023 19:27:27 +0100 Subject: [PATCH] fix: Text Editor behaving a bit weirdly now --- lib/external/imgui/source/TextEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/external/imgui/source/TextEditor.cpp b/lib/external/imgui/source/TextEditor.cpp index 999d19cfb..a47f7dbff 100644 --- a/lib/external/imgui/source/TextEditor.cpp +++ b/lib/external/imgui/source/TextEditor.cpp @@ -2123,7 +2123,7 @@ void TextEditor::EnsureCursorVisible() { if (len + mTextStart < left + 4) ImGui::SetScrollX(std::max(0.0f, len + mTextStart - 4)); if (len + mTextStart > right - 4) - ImGui::SetScrollX(std::max(0.0f, len + mTextStart + 4)); + ImGui::SetScrollX(std::max(0.0f, len + mTextStart + 4 - width + mCharAdvance.x * 2)); } int TextEditor::GetPageSize() const {