Fix for "0052652: Creation 2D polyline does not work properly" issue

This commit is contained in:
ana 2015-04-01 16:36:47 +03:00
parent 55bf84458b
commit 5d72df656f

View File

@ -954,17 +954,10 @@ void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
return; return;
gp_Pnt aPnt; gp_Pnt aPnt;
ic->InitSelected();
if ( pe->modifiers() == Qt::ShiftModifier )
ic->ShiftSelect(); // Append selection
else
ic->Select(); // New selection
{
OCCViewer_ViewPort3d* vp = getViewPort(); OCCViewer_ViewPort3d* vp = getViewPort();
aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() ); aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
}
// set the coordinates into dialog // set the coordinates into dialog
CurveCreator::Coordinates aCoords; CurveCreator::Coordinates aCoords;
aCoords.push_back( aPnt.X() ); aCoords.push_back( aPnt.X() );
@ -1012,7 +1005,12 @@ void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent
*/ */
void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEvent* theEvent ) void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEvent* theEvent )
{ {
if ( getActionMode() != ModificationMode )
{
// Emit selectionChanged() signal
getOCCViewer()->performSelectionChanged();
return;
}
if (theEvent->button() != Qt::LeftButton) return; if (theEvent->button() != Qt::LeftButton) return;
if (!theWindow->inherits("OCCViewer_ViewWindow")) return; if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
@ -1058,13 +1056,6 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
} }
} }
if ( getActionMode() != ModificationMode )
{
// Emit selectionChanged() signal
getOCCViewer()->performSelectionChanged();
return;
}
if ( myDragStarted ) { if ( myDragStarted ) {
bool isDragged = myDragged; bool isDragged = myDragged;
CurveCreator_ICurve::SectionToPointList aDraggedPoints; CurveCreator_ICurve::SectionToPointList aDraggedPoints;