From 3ee052316eb0a4857a0241a22275528191ce3687 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 13 Dec 2013 06:15:04 +0000 Subject: [PATCH] bug #232: fit all on image show --- src/HYDROGUI/HYDROGUI_ShowHideOp.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx b/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx index 90a1c4d1..6ff79894 100644 --- a/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ShowHideOp.cxx @@ -99,6 +99,7 @@ void HYDROGUI_ShowHideOp::startOperation() } } + bool isFoundImage = false; // for selected objects if( myId == ShowId || myId == ShowOnlyId || myId == HideId ) { @@ -111,6 +112,9 @@ void HYDROGUI_ShowHideOp::startOperation() anObject = aSeq.Value( anIndex ); if( !anObject.IsNull() ) { + if ( anObject->GetKind() == KIND_IMAGE ) + isFoundImage = true; + module()->setObjectVisible( aViewId, anObject, aVisibility ); if ( anObject->GetKind() == KIND_REGION ) { @@ -150,7 +154,8 @@ void HYDROGUI_ShowHideOp::startOperation() if ( myId == ShowOnlyId || myId == ShowId || myId == ShowAllId ) { - //anUpdateFlags |= UF_FitAll; + if( isFoundImage || myId == ShowAllId ) + anUpdateFlags |= UF_FitAll; } // Set VTK viewer active if show a bathymetry -- 2.39.2