Skip to content
Permalink
Browse files

Fix wrong scrolling (#6809)

  • Loading branch information...
numberZero authored and SmallJoker committed Dec 21, 2017
1 parent d04c41a commit 257626ceedc986de822eac5f9708e505b41ec87d
Showing with 4 additions and 7 deletions.
  1. +4 −7 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)

0 comments on commit 257626c

Please sign in to comment.
You can’t perform that action at this time.