// Create preview presentation if necessary
if ( !myPreviewPrs ) {
LightApp_Application* anApp = module()->getApp();
- OCCViewer_ViewManager* aViewManager = ::qobject_cast<OCCViewer_ViewManager*>(
- anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
-
+
+ if ( !getPreviewManager() )
+ setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
+ anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+ OCCViewer_ViewManager* aViewManager = getPreviewManager();
if ( aViewManager ) {
if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( !aCtx.IsNull() ) {
- myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL );
+ myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
myPreviewPrs->setFillingColor( myEditedObject->GetFillingColor(), false, false );
myPreviewPrs->setBorderColor( myEditedObject->GetBorderColor(), false, false );
}