Whiteboard - straight lines

Hello,

I have developed a whiteboard, and one of the tools is a straight line where you click on one point and drag the mouse to the location you want the other point to end up. While this is happening the line will be visible, moving wiht your mouse until you release.

Currently, each time the mouse is moved…it draws a line to that new location, thus the old lines must be removed inorder to provide the illusion that it is actually only one line being drawn. I am wondering if there is a way to remove those previous lines so that only one line is showing up.

I tried jsut re-drawing the old lines in white, and that worked…until i drew a line over top of another line and it started painting the other line white.

If someone could help and perhaps mention a method or tool that remedies this problem, it will be much appreciated!