From 1784be046fa51656426b647792c7b112fa1436e0 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Wed, 3 Dec 2025 15:29:01 +0100 Subject: [PATCH 1/2] Sketcher: Make VPSketch::addSelection public --- src/Mod/Sketcher/Gui/ViewProviderSketch.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index d62997a884..6b7bef83ad 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -690,6 +690,11 @@ public: void deleteSelected(); + bool isSelected(const std::string& ss) const; + void rmvSelection(const std::string& subNameSuffix); + bool addSelection(const std::string& subNameSuffix, float x = 0, float y = 0, float z = 0); + bool addSelection2(const std::string& subNameSuffix, float x = 0, float y = 0, float z = 0); + /// Control the overlays appearing on the Tree and reflecting different sketcher states QIcon mergeColorfulOverlayIcons(const QIcon& orig) const override; @@ -829,10 +834,6 @@ private: void removeSelectPoint(int SelectPoint); void clearSelectPoints(); - bool isSelected(const std::string& ss) const; - void rmvSelection(const std::string& subNameSuffix); - bool addSelection(const std::string& subNameSuffix, float x = 0, float y = 0, float z = 0); - bool addSelection2(const std::string& subNameSuffix, float x = 0, float y = 0, float z = 0); void preselectToSelection( const std::stringstream& ss, boost::scoped_ptr& pp, From 0c34c93fe41f3a1f396202df38001791508da001 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Wed, 3 Dec 2025 15:30:44 +0100 Subject: [PATCH 2/2] Sketcher: dimension tool, use VPSketch version of addSelection --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index cc3914edac..c5bc4a4c4b 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1948,9 +1948,7 @@ public: if (selAllowed) { // If mouse is released on something allowed, select it - Gui::Selection().addSelection(Obj->getDocument()->getName(), - Obj->getNameInDocument(), - ss.str().c_str(), onSketchPos.x, onSketchPos.y, 0.f); + sketchgui->addSelection2(ss.str().c_str(), onSketchPos.x, onSketchPos.y, 0.f); sketchgui->draw(false, false); // Redraw } else { @@ -1967,9 +1965,7 @@ public: restartCommand(QT_TRANSLATE_NOOP("Command", "Dimension")); } - Gui::Selection().rmvSelection(Obj->getDocument()->getName(), - Obj->getNameInDocument(), - ss.str().c_str()); + sketchgui->rmvSelection(ss.str().c_str()); sketchgui->draw(false, false); // Redraw }