When moving the cursor down line by line, the text doesn't scroll until you move the cursor down below the last visible line, at which point it scrolls down to keep the cursor in view. But when you then start scrolling up, it scrolls up immediately when you move up a line rather than the proper behavior which would be to not scroll until the cursor is moved above the top most visible line.
I found a fix for this so here it is
(This code is based on the 1.7 branch)
In CGUIEditBox, in the calculateScrollPos() function, this is the incorrect code:
Code: Select all
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;
Code: Select all
if (CurrentTextRect.LowerRightCorner.Y > FrameRect.LowerRightCorner.Y)
VScrollPos = CurrentTextRect.LowerRightCorner.Y + VScrollPos - FrameRect.LowerRightCorner.Y;
else if (CurrentTextRect.UpperLeftCorner.Y < FrameRect.UpperLeftCorner.Y)
VScrollPos = CurrentTextRect.UpperLeftCorner.Y + VScrollPos - FrameRect.UpperLeftCorner.Y;