you have to use a line painting algorithm. paint a line from the old mousecoordinate to the new one