From d3d6c4c03b5160de3a98f68739df842b9bb198a7 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 6 Apr 2017 10:50:51 +0300 Subject: [PATCH] Issue #2107 impossible to select segment for trim --- src/PartSet/PartSet_WidgetFeaturePointSelector.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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())); -- 2.39.2