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>
         public void ChangeState(bool nowDrawing)
         {
-            if(inDrawingMode && !nowDrawing && currentLine.Count > 0)
+            if(inDrawingMode && !nowDrawing && currentLine.Count > 0 && optiTrackInUse)
                 FinishCurrentLine(true);
             inDrawingMode = nowDrawing;
             UpdateUI();
@@ -521,7 +521,8 @@ namespace SketchAssistantWPF
         /// <param name="p">The new cursor position</param>
         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
             mouseDown = programPresenter.IsMousePressed();
         }

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

@@ -193,15 +193,18 @@ namespace SketchAssistantWPF
         /// </summary>
         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);
+                }
             }
         }