Cleanup in content_mapblock (#5746)
[oweals/minetest.git] / 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);