From c9ce0d3cdc88020c51bd3b527288c8aa8e249581 Mon Sep 17 00:00:00 2001 From: mzn Date: Fri, 3 Apr 2015 16:25:26 +0300 Subject: [PATCH] refs #499: Fatal error when Edit image. --- src/HYDROGUI/HYDROGUI_ImportImageOp.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index afa0aa74..6a28b637 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -615,7 +615,12 @@ void HYDROGUI_ImportImageOp::onCreatePreview( QImage theImage ) aViewPort->addItem( myPreviewPrs ); aViewPort->fitAll(); - + + if ( myEditedObject ) { + size_t aViewId = (size_t)aViewer; + module()->setObjectVisible( aViewId, myEditedObject, true ); + } + myPreviewPrs->setIsTransformationPointPreview( true ); } connect( aViewer, SIGNAL( selectionChanged( GV_SelectionChangeStatus ) ), @@ -738,9 +743,13 @@ void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName ) if( !aViewPort ) return; + size_t aViewId = (size_t)myRefViewManager->getViewer(); + // Remove the old presentation of the reference image if any if( myRefPreviewPrs ) { + module()->setObjectVisible( aViewId, myRefPreviewPrs->getObject(), false ); + myRefPreviewPrs->setCaption( QString() ); aViewPort->removeItem( myRefPreviewPrs ); @@ -767,6 +776,8 @@ void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName ) // Add the new reference image presentation to the appropriate view aViewPort->addItem( myRefPreviewPrs ); + + module()->setObjectVisible( aViewId, anImageObj, true ); } aViewPort->fitAll(); -- 2.39.2