summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVitaliy <silverunicorn2011@yandex.ru>2017-12-21 22:58:06 +0300
committerSmallJoker <SmallJoker@users.noreply.github.com>2017-12-21 20:58:06 +0100
commit257626ceedc986de822eac5f9708e505b41ec87d (patch)
treec8679ccaebd582ba2d55a0e1916b8b422c18a2d8 /src
parentd04c41ad80650822be0ff3d18f253a0dbd570116 (diff)
downloadminetest-257626ceedc986de822eac5f9708e505b41ec87d.tar.gz
minetest-257626ceedc986de822eac5f9708e505b41ec87d.tar.bz2
minetest-257626ceedc986de822eac5f9708e505b41ec87d.zip
Fix wrong scrolling (#6809)
Diffstat (limited to 'src')
-rw-r--r--src/gui/intlGUIEditBox.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/intlGUIEditBox.cpp b/src/gui/intlGUIEditBox.cpp
index c03256ede..f5ea5b47f 100644
--- a/src/gui/intlGUIEditBox.cpp
+++ b/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)