Bladeren bron

Fixed error when changing drawing mode while drawing mid air

Martin Edlund (Laptop) 5 jaren geleden
bovenliggende
commit
c1a2ff4d09

+ 5 - 1
SketchAssistant/SketchAssistantWPF/MVP_Model.cs

@@ -312,7 +312,7 @@ namespace SketchAssistantWPF
 
             if (optiTrackZ < -2.2 * WARNING_ZONE_BOUNDARY)
                 programPresenter.SetOverlayColor("optipoint", Brushes.Yellow);
-            else if (optiTrackZ > 1.5 * WARNING_ZONE_BOUNDARY)
+            else if (optiTrackZ > 2 * WARNING_ZONE_BOUNDARY)
                 programPresenter.SetOverlayColor("optipoint", Brushes.Red);
             else
                 programPresenter.SetOverlayColor("optipoint", Brushes.Green);
@@ -345,6 +345,8 @@ namespace SketchAssistantWPF
         /// </summary>
         public void ResetRightImage()
         {
+            if(currentLine.Count > 0)
+                FinishCurrentLine(true);
             rightLineList.Clear();
             programPresenter.PassLastActionTaken(historyOfActions.Reset());
             programPresenter.ClearRightLines();
@@ -441,6 +443,8 @@ namespace SketchAssistantWPF
         /// <param name="nowDrawing">The new drawingstate of the program</param>
         public void ChangeState(bool nowDrawing)
         {
+            if(inDrawingMode && !nowDrawing && currentLine.Count > 0)
+                FinishCurrentLine(true);
             inDrawingMode = nowDrawing;
             UpdateUI();
         }

+ 1 - 1
SketchAssistant/SketchAssistantWPF/MainWindow.xaml.cs

@@ -49,7 +49,7 @@ namespace SketchAssistantWPF
             //  DispatcherTimer setup
             dispatcherTimer = new DispatcherTimer(DispatcherPriority.Render);
             dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
-            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 10);
+            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 5);
             ProgramPresenter.Resize(new Tuple<int, int>((int)LeftCanvas.Width, (int)LeftCanvas.Height),
                 new Tuple<int, int>((int)RightCanvas.Width, (int)RightCanvas.Height));
             //Setup overlay items