diff --git a/lib/third_party/imgui/ColorTextEditor/include/TextEditor.h b/lib/third_party/imgui/ColorTextEditor/include/TextEditor.h index f9cdd0867..e4521ce70 100644 --- a/lib/third_party/imgui/ColorTextEditor/include/TextEditor.h +++ b/lib/third_party/imgui/ColorTextEditor/include/TextEditor.h @@ -629,7 +629,6 @@ private: uint64_t mStartTime = 0; std::vector mDefines; TextEditor *mSourceCodeEditor = nullptr; - float mSavedScrollY = 0; float mShiftedScrollY = 0; float mScrollY = 0; float mScrollYIncrement = 0.0F; diff --git a/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp b/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp index c86d435ba..5ba2d1e5a 100644 --- a/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp +++ b/lib/third_party/imgui/ColorTextEditor/source/TextEditor.cpp @@ -1179,8 +1179,6 @@ void TextEditor::RenderText(const char *aTitle, const ImVec2 &lineNumbersStartPo if (mTopMarginChanged) { mTopMarginChanged = false; - if (mTopMargin == 0) - mSavedScrollY = ImGui::GetScrollY(); auto window = ImGui::GetCurrentWindow(); auto maxScroll = window->ScrollMax.y; if (maxScroll > 0) { @@ -1196,10 +1194,8 @@ void TextEditor::RenderText(const char *aTitle, const ImVec2 &lineNumbersStartPo if (mNewTopMargin > mTopMargin) mShiftedScrollY = oldScrollY + pixelCount; - else if (mNewTopMargin > 0) - mShiftedScrollY = oldScrollY - pixelCount; else - mShiftedScrollY = mSavedScrollY; + mShiftedScrollY = oldScrollY - pixelCount; ImGui::SetScrollY(mShiftedScrollY); mTopMargin = mNewTopMargin; }