]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Refs #277 - New point is added during selection operation
authornds <nds@opencascade.com>
Tue, 24 Dec 2013 13:55:05 +0000 (13:55 +0000)
committernds <nds@opencascade.com>
Tue, 24 Dec 2013 13:55:05 +0000 (13:55 +0000)
src/HYDROCurveCreator/CurveCreator_Widget.cxx
src/HYDROCurveCreator/CurveCreator_Widget.h

index dc2aff372fe74bc9bd5d2cb5350693d558321b81..e4df186f745a85e4644df01d6ef12740a5b6cc96 100644 (file)
@@ -952,6 +952,9 @@ void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent
   if ( theEvent->button() != Qt::LeftButton )
     return;
 
+  myPressedX = theEvent->x();
+  myPressedY = theEvent->y();
+
   switch( getActionMode() ) {
     case ModificationMode: {
       //store initial cursor position for Drag&Drop
@@ -1047,7 +1050,12 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEven
     }
   }
   else // check whether the segment is clicked an a new point should be added to the segment
-    insertPointToSelectedSegment( theEvent->pos().x(), theEvent->pos().y() );
+  {
+    int aReleasedX = theEvent->x();
+    int aReleasedY = theEvent->y();
+    if ( myPressedX == aReleasedX && myPressedY == aReleasedY )
+      insertPointToSelectedSegment( aReleasedX, aReleasedY );
+  }
 
   // updates the input panel table to show the selected point coordinates
   updateLocalPointView();
index 7ab17331db1cb62f909107616235a272e4078ee7..f3fba8a12b57d15eae6f4698f8e2f12ba24ba6ea 100644 (file)
@@ -218,6 +218,8 @@ private:
   QMap<CurveCreator_ICurve::SectionToPoint, CurveCreator::Coordinates> myInitialDragPointsCoords;
   bool                        myDragged;
   QByteArray                  myGuiState;
+  int                         myPressedX;
+  int                         myPressedY;
 };
 
 #endif // CURVECREATOR_WIDGET_H