From 4d447bcb24eee6bf3db0697e8e30c941cabc64e0 Mon Sep 17 00:00:00 2001 From: Ajinkya Dahale Date: Wed, 21 Aug 2024 00:58:13 +0530 Subject: [PATCH] [Sketcher] Fix #14736 Recompute even if the addition of new elements and autoconstraints failed partially. --- src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h b/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h index 866304d38b..2a98091feb 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h +++ b/src/Mod/Sketcher/Gui/DrawSketchDefaultHandler.h @@ -497,8 +497,6 @@ protected: createAutoConstraints(); } - - tryAutoRecomputeIfNotSolve(sketchgui->getSketchObject()); } catch (const Base::RuntimeError& e) { // RuntimeError exceptions inside of the block above must provide a translatable @@ -507,6 +505,17 @@ protected: Base::Console().Error(e.what()); } + // Keep the recompute separate so that everything is drawn even if execution fails + // partially + try { + tryAutoRecomputeIfNotSolve(sketchgui->getSketchObject()); + } + catch (const Base::RuntimeError& e) { + // RuntimeError exceptions inside of the block above must provide a translatable + // message. It is reported both to developer (report view) and user (notifications + // area). + Base::Console().Error(e.what()); + } return handleContinuousMode(); } return false;