Ok I believe I understand what you are saying now. Basically the line segment is ending at 800 pixels and you want it to continue going on father then that.
Note: If you let me know what library you are using I might be able to provide you with more information that pertains specifically to that library.
In order to fully understand what is happening and why you should know what the screen coordinate system is and what the world coordinate system is.
Basically in your game the screen coordinate system is what you see in your game window. It is 800 x 400 pixels and that is your screen coordinate space.
What is displayed on your screen coordinate system is determined where the camera is at in the world coordinate space. The world coordinate space goes way beyond the left, right, top and bottom of your game window and you can have objects anywhere in that space.
Basically think of your game window as a rectangle that is only seeing a certain part of the game world. When your ball moves it moves the rectangle (Camera) along with it.
So lets say you move your camera +800 pixels along the X axis and +200 pixels along the Y axis . This would mean that the top left corner of your rectangle (Camera) is now positioned at (800, 200) in world coordinates
Here is a diagram to help visualize this.
Before the move
World
(0, 0) is in the corner
______________________ World X Axis
| |
| |
| |
| |
|________|
|
|
|
|
|
|
|
World Y Axis |
World
(0, 0) is in the corner
______________________ World X Axis
|
| ___________
| | |
| | |
| | |
| | |
| |__________|
|
|
|
World Y Axis |
The little box is what your screen is showing of the world coordinate system. So by moving your camera you are moving around in the world coordinate system and whenever something goes outside of your rectangle it will no longer be drawn (But it will still be there). The same goes the other way around.
So now that I got my crappy explanation of the different coordinate systems out of the way lets get to the fix ;p.
The fix is actually quite easy to do. All you need to do is change the size of your line segment so it is more then 800 pixel long on the X axis. Since the world coordinate system basically goes on for infinity you can make it as long as you want (Though I wouldn't make it more then what you need).
So if you change it so that your line segment is 5200 (Or however long you want it) pixels long on the X axis instead of 800 you should be fine.
Though be cautious since I am not sure what library you are using I am not sure if they do culling while drawing (Basically what that means is they only draw things that are on screen) so you might want to look into that sometime later and see how to do it.
Anyways for the short answer to your solution if you skipped reading my wall of text all you need to do is change the size of your line segment to more then 800 pixels ;p.
Hope this helped a bit and hope it is somewhat comprehensible.