Clamp position of object in the boundary, or wrap the position at the other boundary. I'm not the author of this addon, I just ported it.