Преглед на файлове

fix some bugs while operating the visual stage.

gsp преди 3 години
родител
ревизия
18b24fb28a

+ 3 - 0
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/CreateRectangle.cs

@@ -894,6 +894,7 @@ namespace OTSMeasureApp
         }
 
         public int SequenceNum { get => m_sequenceNum; set => m_sequenceNum = value; }
+        public bool IsMoving { get => m_IsMoving; set => m_IsMoving = value; }
 
         public PointF GetDisplayRefPoint()
         { return m_refPoint; }
@@ -1188,6 +1189,8 @@ namespace OTSMeasureApp
       
         //是否设置为拖动
         private bool m_IsDragging;
+
+        private bool m_IsMoving;
         //是否为工作样品
         private bool m_IsWorkSample;
         private CreateRectangleType createType;

+ 28 - 17
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -1877,8 +1877,13 @@ namespace OTSMeasureApp
                                 {
                                     if (curMeasureGdi.GetGPath().IsVisible(e.Location))
                                     {
-
-                                        curMeasureGdi.PositionAltering(e.Location,true);
+                                        if (m_visualStage.GetEdgeGDIObj().GetGPath().IsVisible(e.Location))
+                                       {
+                                          
+                                                curMeasureGdi.PositionAltering(e.Location, true);
+                                           
+                                        }
+                                       
                                     }
                     
                                 }
@@ -1914,11 +1919,7 @@ namespace OTSMeasureApp
             {
                 return;
             }
-            var selWSampleMeasureStatus = m_MeasureAppForm.m_ProjParam.GetWorkSampleMeasureStatus();
-            if (selWSampleMeasureStatus)
-            {
-                return;
-            }
+        
             var sam = GetWorkingVisualSample();
 
             //判断当前是否手绘
@@ -1968,17 +1969,20 @@ namespace OTSMeasureApp
                 var measureItem = sam.GetMeasureGDIObject();
                 if (measureItem.IsDragging || measureItem.IsAltering)//while pressing ctrl key then it must be altering something(position or size)
                 {
-
-                    var para = m_visualStage.GetSampleMeasurePara(measureItem);
-                    m_MeasureAppForm.m_ProjParam.SetWorkSampleHoleAndMeasureArea(para);//set the altering result to the public parameter object
+                    var selWSampleMeasureStatus = m_MeasureAppForm.m_ProjParam.GetWorkSampleMeasureStatus();
+                    if (!selWSampleMeasureStatus)
+                    {
+                        
+                            var para = m_visualStage.GetSampleMeasurePara(measureItem);
+                            m_MeasureAppForm.m_ProjParam.SetWorkSampleHoleAndMeasureArea(para);//set the altering result to the public parameter object
 
 
-                    this.Cursor = System.Windows.Forms.Cursors.Default;
+                            this.Cursor = System.Windows.Forms.Cursors.Default;
 
-                    m_MeasureAppForm.m_RunType = MSR_THREAD_RunSTATUS.RUNMEASURE;
-                    CMeasureThreadWrapper.DoRunType = MSR_THREAD_RunSTATUS.RUNMEASURE;
-
-                    PrepareMeasureField(sam);
+                            PrepareMeasureField(sam);
+                        
+                       
+                    }
 
                     measureItem.IsAltering = false;
                     measureItem.IsDragging = false;
@@ -2145,7 +2149,7 @@ namespace OTSMeasureApp
 
             foreach (CRectangleGDIObject item in objList)
             {
-                item.IsDragging = true;
+                item.IsMoving = true;
                 item.DraggingPoint = e.Location;
             }
         }
@@ -2153,7 +2157,7 @@ namespace OTSMeasureApp
         {
             foreach (CRectangleGDIObject item in objList)
             {
-                if (item.IsDragging)
+                if (item.IsMoving)
                 {
                   
                     item.Move(e.Location);
@@ -2174,6 +2178,13 @@ namespace OTSMeasureApp
                     item.DraggingPoint = Point.Empty;
                     
                 }
+                if (item.IsMoving)
+                {
+
+                    item.IsMoving = false;
+                    item.DraggingPoint = Point.Empty;
+
+                }
             }
         }