Sketcher: Improve circle constraint position (#23569)
* Make prevCursorPosition protected so tools can use it * DrawSketchHandlerCircle : Position constraint on prevCursorPosition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -145,8 +145,9 @@ protected:
|
||||
};
|
||||
//@}
|
||||
|
||||
private:
|
||||
Base::Vector2d prevCursorPosition;
|
||||
|
||||
private:
|
||||
Base::Vector2d lastControlEnforcedPosition;
|
||||
|
||||
int nOnViewParameter = OnViewParametersT::defaultMethodSize();
|
||||
|
||||
@@ -720,9 +720,7 @@ void DSHCircleController::addConstraints()
|
||||
const std::vector<Sketcher::Constraint*>& ConStr =
|
||||
handler->sketchgui->getSketchObject()->Constraints.getValues();
|
||||
int index = static_cast<int>(ConStr.size()) - 1;
|
||||
Base::Vector2d dir = handler->secondPoint - handler->centerPoint;
|
||||
Base::Vector2d toPnt = handler->secondPoint + dir * 0.3;
|
||||
handler->moveConstraint(index, toPnt);
|
||||
handler->moveConstraint(index, prevCursorPosition);
|
||||
};
|
||||
|
||||
// NOTE: if AutoConstraints is empty, we can add constraints directly without any diagnose.
|
||||
|
||||
Reference in New Issue
Block a user