lines updating properly when dragging the mouse