From 6d1c9b41614f6ea80db569261d36bc60d69aa5c5 Mon Sep 17 00:00:00 2001 From: Paddle Date: Mon, 30 Oct 2023 15:56:26 +0100 Subject: [PATCH] DSDH : add canGoToNextMode() methode in onButtonPressed. So that we can prevent going to the next mode on certain conditions. --- src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h b/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h index 070dceb807..5118598dec 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h +++ b/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h @@ -589,7 +589,14 @@ protected: virtual void onButtonPressed(Base::Vector2d onSketchPos) { this->updateDataAndDrawToPosition(onSketchPos); - this->moveToNextMode(); + if (canGoToNextMode()) { + this->moveToNextMode(); + } + } + + virtual bool canGoToNextMode() + { + return true; } /** @brief Default behaviour that upon arriving to the End state of the state machine, the