modify the condition when the arrow reaches the bounds

To make the window look better