From e4bc11d9737107465c2e2b3e35e9cd7fc9d3dd2d Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:16:37 +0100 Subject: [PATCH] [GUI] Allow origin plane/axis selection with entire label bounding box --- src/Gui/ViewProviderLine.cpp | 5 +++++ src/Gui/ViewProviderPlane.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Gui/ViewProviderLine.cpp b/src/Gui/ViewProviderLine.cpp index bdae7a5f8b..172f6f5356 100644 --- a/src/Gui/ViewProviderLine.cpp +++ b/src/Gui/ViewProviderLine.cpp @@ -29,6 +29,7 @@ # include # include # include +# include # include # include #endif @@ -76,5 +77,9 @@ void ViewProviderLine::attach ( App::DocumentObject *obj ) { textTranslation->translation.setValue ( SbVec3f ( -size * 49. / 50., size / 30., 0 ) ); sep->addChild ( textTranslation ); + SoPickStyle *ps = new SoPickStyle(); + ps->style.setValue(SoPickStyle::BOUNDING_BOX); + sep->addChild(ps); + sep->addChild ( getLabel () ); } diff --git a/src/Gui/ViewProviderPlane.cpp b/src/Gui/ViewProviderPlane.cpp index 02fa1b550e..32401618bb 100644 --- a/src/Gui/ViewProviderPlane.cpp +++ b/src/Gui/ViewProviderPlane.cpp @@ -29,6 +29,7 @@ # include # include # include +# include # include # include #endif @@ -78,5 +79,9 @@ void ViewProviderPlane::attach ( App::DocumentObject *obj ) { textTranslation->translation.setValue ( SbVec3f ( -size * 49. / 50., size * 9./10., 0 ) ); sep->addChild ( textTranslation ); + SoPickStyle *ps = new SoPickStyle(); + ps->style.setValue(SoPickStyle::BOUNDING_BOX); + sep->addChild(ps); + sep->addChild ( getLabel () ); }