From 4a95c89c612cdf3c50a876b77a93226694bcd918 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 12 Jan 2015 18:21:22 +0300 Subject: [PATCH] Fix a bug: FitAll does not properly works for small objects (with bounding box's size < 1) --- src/VTKViewer/VTKViewer_Utilities.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/VTKViewer/VTKViewer_Utilities.cxx b/src/VTKViewer/VTKViewer_Utilities.cxx index 19c3892c1..67916a8d5 100755 --- a/src/VTKViewer/VTKViewer_Utilities.cxx +++ b/src/VTKViewer/VTKViewer_Utilities.cxx @@ -128,17 +128,17 @@ ComputeVisiblePropBounds(vtkRenderer* theRenderer, static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT; static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; - if(abs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) { + if(fabs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) { aBounds[0]-=0.001; aBounds[1]+=0.001; } - if(abs(aBounds[3] - aBounds[2]) < MIN_DISTANCE) { + if(fabs(aBounds[3] - aBounds[2]) < MIN_DISTANCE) { aBounds[2]-=0.001; aBounds[3]+=0.001; } - if(abs(aBounds[5] - aBounds[4]) < MIN_DISTANCE) { + if(fabs(aBounds[5] - aBounds[4]) < MIN_DISTANCE) { aBounds[4]-=0.001; aBounds[5]+=0.001; } -- 2.39.2