snap to edge when within certain boundary