From f6624a6d7fa8aa3034fd0d397918630228596ca6 Mon Sep 17 00:00:00 2001 From: logari81 Date: Tue, 4 Sep 2012 14:40:05 +0200 Subject: [PATCH] Sketcher: fix an issue when a polyline is started at the start point of an existing line segment --- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 0a0184711..ade7d2a5f 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -740,7 +740,7 @@ public: sugConstr1[i].PosId == Sketcher::end)) { previousCurve = sugConstr1[i].GeoId; previousPosId = sugConstr1[i].PosId; - updateTransitionData(previousCurve,previousPosId); // -> dirVec, EditMode[0] + updateTransitionData(previousCurve,previousPosId); // -> dirVec, EditCurve[0] if (geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) TransitionMode = TRANSITION_MODE_Tangent; sugConstr1.erase(sugConstr1.begin()+i); // actually we should clear the vector completely @@ -923,12 +923,15 @@ protected: const Part::Geometry *geom = sketchgui->getSketchObject()->getGeometry(GeoId); if (geom->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { const Part::GeomLineSegment *lineSeg = dynamic_cast(geom); - EditCurve[0] = Base::Vector2D(lineSeg->getEndPoint().x, lineSeg->getEndPoint().y); dirVec.Set(lineSeg->getEndPoint().x - lineSeg->getStartPoint().x, lineSeg->getEndPoint().y - lineSeg->getStartPoint().y, 0.f); - if (PosId == Sketcher::start) + if (PosId == Sketcher::start) { dirVec *= -1; + EditCurve[0] = Base::Vector2D(lineSeg->getStartPoint().x, lineSeg->getStartPoint().y); + } + else + EditCurve[0] = Base::Vector2D(lineSeg->getEndPoint().x, lineSeg->getEndPoint().y); } else if (geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) { const Part::GeomArcOfCircle *arcSeg = dynamic_cast(geom);