by releasing the mouse button it has to draw line
Call "update()" after storing the coordinates and releasing the mouse button.