From 26a1d89b6ee98e29ea32ea83021fbe443a81163b Mon Sep 17 00:00:00 2001 From: logari81 Date: Fri, 11 Nov 2011 11:49:08 +0000 Subject: [PATCH] + fix a small bug in constraint datum dragging git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5117 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 184c2e8db..133583767 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -904,9 +904,9 @@ void ViewProviderSketch::moveConstraint(int constNum, const Base::Vector2D &toPo if (Constr->Type == Distance || Constr->Type == Radius) dir = (p2-p1).Normalize(); else if (Constr->Type == DistanceX) - dir = Base::Vector3d( (p2.x > p1.x) ? 1 : -1, 0, 0); + dir = Base::Vector3d( (p2.x - p1.x >= FLT_EPSILON) ? 1 : -1, 0, 0); else if (Constr->Type == DistanceY) - dir = Base::Vector3d(0, (p2.y > p1.y) ? 1 : -1, 0); + dir = Base::Vector3d(0, (p2.y - p1.y >= FLT_EPSILON) ? 1 : -1, 0); if (Constr->Type == Radius) Constr->LabelDistance = vec.x * dir.x + vec.y * dir.y; @@ -2847,7 +2847,7 @@ void ViewProviderSketch::unsetEdit(int ModNum) // and update the sketch getSketchObject()->getDocument()->recompute(); - // clear the selction and set the new/edited sketch(convenience) + // clear the selection and set the new/edited sketch(convenience) Gui::Selection().clearSelection(); std::string ObjName = getSketchObject()->getNameInDocument(); std::string DocName = getSketchObject()->getDocument()->getName();