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