Skip to content

Commit 257626c

Browse files
numberZeroSmallJoker
authored andcommittedDec 21, 2017
Fix wrong scrolling (#6809)
1 parent d04c41a commit 257626c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
 

‎src/gui/intlGUIEditBox.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -1431,13 +1431,10 @@ void intlGUIEditBox::calculateScrollPos()
14311431
}
14321432

14331433
// vertical scroll position
1434-
if (FrameRect.LowerRightCorner.Y < CurrentTextRect.LowerRightCorner.Y + VScrollPos)
1435-
VScrollPos = CurrentTextRect.LowerRightCorner.Y - FrameRect.LowerRightCorner.Y + VScrollPos;
1436-
1437-
else if (FrameRect.UpperLeftCorner.Y > CurrentTextRect.UpperLeftCorner.Y + VScrollPos)
1438-
VScrollPos = CurrentTextRect.UpperLeftCorner.Y - FrameRect.UpperLeftCorner.Y + VScrollPos;
1439-
else
1440-
VScrollPos = 0;
1434+
if (FrameRect.LowerRightCorner.Y < CurrentTextRect.LowerRightCorner.Y)
1435+
VScrollPos += CurrentTextRect.LowerRightCorner.Y - FrameRect.LowerRightCorner.Y; // scrolling downwards
1436+
else if (FrameRect.UpperLeftCorner.Y > CurrentTextRect.UpperLeftCorner.Y)
1437+
VScrollPos += CurrentTextRect.UpperLeftCorner.Y - FrameRect.UpperLeftCorner.Y; // scrolling upwards
14411438

14421439
// todo: adjust scrollbar
14431440
if (m_vscrollbar)

0 commit comments

Comments
 (0)