Fix input regression introduced by a4a377ecad6f1732cc54e7ac329fdef9949f9bf7
authorLoic Blot <loic.blot@unix-experience.fr>
Sat, 20 May 2017 08:12:54 +0000 (10:12 +0200)
committerLoic Blot <loic.blot@unix-experience.fr>
Sat, 20 May 2017 08:12:54 +0000 (10:12 +0200)
Fix #5776

src/intlGUIEditBox.cpp

index 4cc2d746f628f5f2ec044cbf6ee32f7a59860bc4..9884af003efd09c87d33ae7444b2fd239ffc2c58 100644 (file)
@@ -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);