/// <summary>
 /// Finish the current Line, when the pressed Mouse is released.
 /// Overload that is used to pass a list of points to be used when one is available.
 /// </summary>
 /// <param name="p">The list of points</param>
 public void FinishCurrentLine(List <Point> p)
 {
     mouseDown = false;
     if (inDrawingMode && currentLine.Count > 0)
     {
         InternalLine newLine = new InternalLine(p, rightLineList.Count);
         rightLineList.Add(new Tuple <bool, InternalLine>(true, newLine));
         newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
         programPresenter.PassLastActionTaken(historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID())));
         programPresenter.UpdateRightLines(rightLineList);
         currentLine.Clear();
     }
     UpdateUI();
 }
 /// <summary>
 /// Finish the current Line, when the pressed Mouse is released.
 /// </summary>
 /// <param name="valid">Whether the up event is valid or not</param>
 public void FinishCurrentLine(bool valid)
 {
     mouseDown = false;
     if (valid)
     {
         if (inDrawingMode && currentLine.Count > 0)
         {
             InternalLine newLine = new InternalLine(currentLine, rightLineList.Count);
             rightLineList.Add(new Tuple <bool, InternalLine>(true, newLine));
             newLine.PopulateMatrixes(isFilledMatrix, linesMatrix);
             programPresenter.PassLastActionTaken(historyOfActions.AddNewAction(new SketchAction(SketchAction.ActionType.Draw, newLine.GetID())));
             //TODO: For the person implementing overlay: Add check if overlay needs to be added
             programPresenter.UpdateRightLines(rightLineList);
             currentLine.Clear();
             programPresenter.UpdateCurrentLine(currentLine);
         }
     }
     else
     {
         currentLine.Clear();
     }
     UpdateUI();
 }