Browse Source

Minor fixes

Martin Edlund 5 years ago
parent
commit
afb24e7664

+ 3 - 2
SketchAssistant/SketchAssistantWPF/MVP_Model.cs

@@ -486,7 +486,7 @@ namespace SketchAssistantWPF
         /// <param name="nowDrawing">The new drawingstate of the program</param>
         /// <param name="nowDrawing">The new drawingstate of the program</param>
         public void ChangeState(bool nowDrawing)
         public void ChangeState(bool nowDrawing)
         {
         {
-            if(inDrawingMode && !nowDrawing && currentLine.Count > 0)
+            if(inDrawingMode && !nowDrawing && currentLine.Count > 0 && optiTrackInUse)
                 FinishCurrentLine(true);
                 FinishCurrentLine(true);
             inDrawingMode = nowDrawing;
             inDrawingMode = nowDrawing;
             UpdateUI();
             UpdateUI();
@@ -521,7 +521,8 @@ namespace SketchAssistantWPF
         /// <param name="p">The new cursor position</param>
         /// <param name="p">The new cursor position</param>
         public void SetCurrentCursorPosition(Point p)
         public void SetCurrentCursorPosition(Point p)
         {
         {
-            if (!optiTrackInUse) currentCursorPosition = p;
+            //if (!optiTrackInUse)
+            currentCursorPosition = p;
             //Temporary position of the optipoint change, change this when merging with optitrack branch
             //Temporary position of the optipoint change, change this when merging with optitrack branch
             mouseDown = programPresenter.IsMousePressed();
             mouseDown = programPresenter.IsMousePressed();
         }
         }

+ 11 - 8
SketchAssistant/SketchAssistantWPF/MainWindow.xaml.cs

@@ -193,15 +193,18 @@ namespace SketchAssistantWPF
         /// </summary>
         /// </summary>
         private void RightCanvas_MouseUp(object sender, MouseButtonEventArgs e)
         private void RightCanvas_MouseUp(object sender, MouseButtonEventArgs e)
         {
         {
-            if (strokeCollection.Count == 0)
+            if (ProgramPresenter.GetDrawingState())
             {
             {
-                ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid, strokeCollection);
-            }
-            else
-            {
-                ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up, strokeCollection);
-                RightCanvas.Strokes.RemoveAt(0);
-                strokeCollection.RemoveAt(0);
+                if (strokeCollection.Count == 0)
+                {
+                    ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up_Invalid, strokeCollection);
+                }
+                else
+                {
+                    ProgramPresenter.MouseEvent(MVP_Presenter.MouseAction.Up, strokeCollection);
+                    RightCanvas.Strokes.RemoveAt(0);
+                    strokeCollection.RemoveAt(0);
+                }
             }
             }
         }
         }