summaryrefslogtreecommitdiff
path: root/src/intlGUIEditBox.cpp
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-05-20 10:12:54 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-05-20 10:12:54 +0200
commit1469424075affce7c27bb44e5a5cbd51485e44b2 (patch)
tree9a9568c2c77e5a0b491330f34adb54518813905f /src/intlGUIEditBox.cpp
parentd176dabeb4f04f9a1179cad9b23653fe6e19169e (diff)
downloadminetest-1469424075affce7c27bb44e5a5cbd51485e44b2.tar.gz
minetest-1469424075affce7c27bb44e5a5cbd51485e44b2.tar.bz2
minetest-1469424075affce7c27bb44e5a5cbd51485e44b2.zip
Fix input regression introduced by a4a377ecad6f1732cc54e7ac329fdef9949f9bf7
Fix #5776
Diffstat (limited to 'src/intlGUIEditBox.cpp')
-rw-r--r--src/intlGUIEditBox.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intlGUIEditBox.cpp b/src/intlGUIEditBox.cpp
index 4cc2d746f..9884af003 100644
--- a/src/intlGUIEditBox.cpp
+++ b/src/intlGUIEditBox.cpp
@@ -1120,8 +1120,8 @@ s32 intlGUIEditBox::getCursorPos(s32 x, s32 y)
if (x < CurrentTextRect.UpperLeftCorner.X)
x = CurrentTextRect.UpperLeftCorner.X;
- else if (x > CurrentTextRect.LowerRightCorner.X)
- x = CurrentTextRect.LowerRightCorner.X;
+ else if (x > CurrentTextRect.LowerRightCorner.X + 1)
+ x = CurrentTextRect.LowerRightCorner.X + 1;
s32 idx = font->getCharacterFromPos(Text.c_str(), x - CurrentTextRect.UpperLeftCorner.X);