From: nds Date: Thu, 6 Apr 2017 07:50:51 +0000 (+0300) Subject: Issue #2107 impossible to select segment for trim X-Git-Tag: V_2.7.0~51 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d3d6c4c03b5160de3a98f68739df842b9bb198a7;p=modules%2Fshaper.git Issue #2107 impossible to select segment for trim --- diff --git a/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp b/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp index 663bc658b..f68e580d9 100644 --- a/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp +++ b/src/PartSet/PartSet_WidgetFeaturePointSelector.cpp @@ -132,13 +132,18 @@ void PartSet_WidgetFeaturePointSelector::mouseReleased(ModuleBase_IViewWindow* t if (theEvent->button() != Qt::LeftButton) return; + std::shared_ptr aRefPreviewAttr = + std::dynamic_pointer_cast( + feature()->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); + ObjectPtr aPreviewObject = aRefPreviewAttr->value(); + // do not move focus from the current widget if the object is not highlighted/selected + if (!aPreviewObject.get()) + return; + // set parameters of preview into parameters of selection in the feature std::shared_ptr aRefSelectedAttr = std::dynamic_pointer_cast( feature()->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); - std::shared_ptr aRefPreviewAttr = - std::dynamic_pointer_cast( - feature()->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); aRefSelectedAttr->setValue(aRefPreviewAttr->value()); std::shared_ptr aPointSelectedAttr = @@ -167,9 +172,6 @@ bool PartSet_WidgetFeaturePointSelector::fillFeature( if (theSelectedPrs.get() && theSelectedPrs->object().get()) anObject = theSelectedPrs->object(); - if (!anObject.get()) - return aFilled; - std::shared_ptr aRef = std::dynamic_pointer_cast( feature()->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));