Skip to content

Commit

Permalink
Fix wrong scrolling (#6809)
Browse files Browse the repository at this point in the history
  • Loading branch information
numberZero authored and SmallJoker committed Dec 21, 2017
1 parent d04c41a commit 257626c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gui/intlGUIEditBox.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 257626c

Please sign in to comment.