1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-01 23:50:22 +02:00

Fix wrong scrolling (#6809)

This commit is contained in:
Vitaliy
2017-12-21 22:58:06 +03:00
committed by sfan5
parent fb06fc2704
commit 0bf3804df1

View File

@ -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
}