]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/SketchSolver/SketchSolver_ConstraintMovement.cpp
Salome HOME
Sketcher: Avoid changing radius of circular edges while moving
[modules/shaper.git] / src / SketchSolver / SketchSolver_ConstraintMovement.cpp
index 94c6d7af10066fa33f4489933acae9427abbdb76..f5d6df055692edda89410318425c4c0cc87cb211 100644 (file)
@@ -78,12 +78,14 @@ void SketchSolver_ConstraintMovement::process()
 static bool isSimpleMove(FeaturePtr theMovedFeature, AttributePtr theDraggedPoint)
 {
   bool isSimple = true;
+#ifdef CHANGE_RADIUS_WHILE_MOVE
   if (theMovedFeature->getKind() == SketchPlugin_Circle::ID())
     isSimple = (theDraggedPoint.get() != 0);
   else if (theMovedFeature->getKind() == SketchPlugin_Arc::ID()) {
     isSimple = (theDraggedPoint.get() != 0 &&
                 theDraggedPoint->id() == SketchPlugin_Arc::CENTER_ID());
   }
+#endif
   return isSimple;
 }
 
@@ -213,7 +215,11 @@ void SketchSolver_ConstraintMovement::moveTo(
   double aDelta[2] = { theDestinationPoint->x() - myStartPoint->x(),
                        theDestinationPoint->y() - myStartPoint->y() };
 
+#ifdef CHANGE_RADIUS_WHILE_MOVE
   int aMaxSize = mySimpleMove ? (int)myFixedValues.size() : 2;
+#else
+  int aMaxSize = myMovedFeature->getKind() == SketchPlugin_Line::ID() && !myDraggedPoint ? 4 : 2;
+#endif
   for (int i = 0; i < aMaxSize; ++i)
     myFixedValues[i] += aDelta[i % 2];
 }