fix: Text Editor behaving a bit weirdly now

This commit is contained in:
WerWolv 2023-01-10 19:27:27 +01:00
parent 87571450f4
commit 3b5d54dd96
1 changed files with 1 additions and 1 deletions

View File

@ -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 {