forked from Mirrorlandia_minetest/minetest
Fix wrong scrolling (#6809)
This commit is contained in:
parent
d04c41ad80
commit
257626ceed
@ -1431,13 +1431,10 @@ void intlGUIEditBox::calculateScrollPos()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// vertical scroll position
|
// vertical scroll position
|
||||||
if (FrameRect.LowerRightCorner.Y < CurrentTextRect.LowerRightCorner.Y + VScrollPos)
|
if (FrameRect.LowerRightCorner.Y < CurrentTextRect.LowerRightCorner.Y)
|
||||||
VScrollPos = CurrentTextRect.LowerRightCorner.Y - FrameRect.LowerRightCorner.Y + VScrollPos;
|
VScrollPos += CurrentTextRect.LowerRightCorner.Y - FrameRect.LowerRightCorner.Y; // scrolling downwards
|
||||||
|
else if (FrameRect.UpperLeftCorner.Y > CurrentTextRect.UpperLeftCorner.Y)
|
||||||
else if (FrameRect.UpperLeftCorner.Y > CurrentTextRect.UpperLeftCorner.Y + VScrollPos)
|
VScrollPos += CurrentTextRect.UpperLeftCorner.Y - FrameRect.UpperLeftCorner.Y; // scrolling upwards
|
||||||
VScrollPos = CurrentTextRect.UpperLeftCorner.Y - FrameRect.UpperLeftCorner.Y + VScrollPos;
|
|
||||||
else
|
|
||||||
VScrollPos = 0;
|
|
||||||
|
|
||||||
// todo: adjust scrollbar
|
// todo: adjust scrollbar
|
||||||
if (m_vscrollbar)
|
if (m_vscrollbar)
|
||||||
|
Loading…
Reference in New Issue
Block a user