From 470523cc862ce23a38642e14e345a75861225a78 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 23 Dec 2024 11:44:34 +0100 Subject: [PATCH] fix: Jittery scrolling in Text Editor --- lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp b/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp index a3c21768b..518f30394 100644 --- a/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp +++ b/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp @@ -894,9 +894,9 @@ void TextEditor::Render() { if (mSetTopLine) SetTopLine(); else - mTopLine = std::max(0,(int)(std::floor((scrollY-mTopMargin) / mCharAdvance.y))); - auto lineNo = mTopLine; - auto globalLineMax = (int)mLines.size(); + mTopLine = std::max(0, std::floor((scrollY-mTopMargin) / mCharAdvance.y) - 1); + auto lineNo = mTopLine; + int globalLineMax = mLines.size(); auto lineMax = std::clamp(lineNo + mNumberOfLinesDisplayed, 0, globalLineMax - 1); mLongest = GetLongestLineLength() * mCharAdvance.x;