From: Vitaliy Date: Thu, 21 Dec 2017 19:58:06 +0000 (+0300) Subject: Fix wrong scrolling (#6809) X-Git-Tag: 0.4.17~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b3167d4e5748ffd14efc5981ba8349c01808b78a;p=oweals%2Fminetest.git Fix wrong scrolling (#6809) --- diff --git a/src/intlGUIEditBox.cpp b/src/intlGUIEditBox.cpp index 37687e1e4..ad59ef13a 100644 --- a/src/intlGUIEditBox.cpp +++ b/src/intlGUIEditBox.cpp @@ -1419,13 +1419,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 }