From 257626ceedc986de822eac5f9708e505b41ec87d Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 21 Dec 2017 22:58:06 +0300 Subject: [PATCH] Fix wrong scrolling (#6809) --- src/gui/intlGUIEditBox.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gui/intlGUIEditBox.cpp b/src/gui/intlGUIEditBox.cpp index c03256ede..f5ea5b47f 100644 --- a/src/gui/intlGUIEditBox.cpp +++ b/src/gui/intlGUIEditBox.cpp @@ -1431,13 +1431,10 @@ void intlGUIEditBox::calculateScrollPos() } // vertical scroll position - if (FrameRect.LowerRightCorner.Y < CurrentTextRect.LowerRightCorner.Y + VScrollPos) - VScrollPos = CurrentTextRect.LowerRightCorner.Y - FrameRect.LowerRightCorner.Y + VScrollPos; - - else if (FrameRect.UpperLeftCorner.Y > CurrentTextRect.UpperLeftCorner.Y + VScrollPos) - VScrollPos = CurrentTextRect.UpperLeftCorner.Y - FrameRect.UpperLeftCorner.Y + VScrollPos; - else - VScrollPos = 0; + if (FrameRect.LowerRightCorner.Y < CurrentTextRect.LowerRightCorner.Y) + VScrollPos += CurrentTextRect.LowerRightCorner.Y - FrameRect.LowerRightCorner.Y; // scrolling downwards + else if (FrameRect.UpperLeftCorner.Y > CurrentTextRect.UpperLeftCorner.Y) + VScrollPos += CurrentTextRect.UpperLeftCorner.Y - FrameRect.UpperLeftCorner.Y; // scrolling upwards // todo: adjust scrollbar if (m_vscrollbar)