Sketcher: BSpline DSH: Fix crash: If you create new sketch, start bspline tool and change mode, it would crash. It's because it was doing a abortCommand before the command was opened. So it cancelled the create sketch command.

This commit is contained in:
PaddleStroke
2024-06-27 14:22:26 +02:00
committed by Chris Hennes
parent a161df7ad3
commit c4bf2fb1d6

View File

@@ -88,6 +88,12 @@ public:
, resetSeekSecond(false) {};
~DrawSketchHandlerBSpline() override = default;
void activated() override
{
DrawSketchHandlerBSplineBase::activated();
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch bSpline"));
}
private:
void updateDataAndDrawToPosition(Base::Vector2d onSketchPos) override
{
@@ -453,7 +459,6 @@ private:
? Sketcher::PointPos::mid
: Sketcher::PointPos::start;
if (state() == SelectMode::SeekFirst) {
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch bSpline"));
// insert point for pole/knot, defer internal alignment constraining.
if (!addPos()) {
return false;
@@ -552,6 +557,7 @@ private:
{
Gui::Command::abortCommand();
tryAutoRecomputeIfNotSolve(sketchgui->getSketchObject());
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch bSpline"));
SplineDegree = 3;
geoIds.clear();