Salome HOME
Displaying of objects corrected (Bug #359).
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Shape.cxx
index c5f3bbd2011b0da005c39e9fdce0966a7279837e..3fed9548be2099543ba4eae17dc31127256af861 100644 (file)
@@ -408,14 +408,15 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer,
 void HYDROGUI_Shape::setVisible( const bool theState,
                                  const bool theIsUpdateViewer )
 {
-  if ( myIsVisible == theState )
-    return;
-
   myIsVisible = theState;
 
   if ( myShape.IsNull() )
     return;
 
+  if ( ( myIsVisible && myContext->IsDisplayed( myShape ) ) ||
+       ( !myIsVisible && !myContext->IsDisplayed( myShape ) ) )
+    return;
+
   if ( myIsVisible )
     myContext->Display( myShape, theIsUpdateViewer );
   else