From e04ad69f7095687d1f7c05b1dc4efb9170217444 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 29 Jul 2008 10:29:47 +0000 Subject: [PATCH] merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_29Jul08) --- src/VTKViewer/VTKViewer_Trihedron.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index d9f5d3321..7781f1b57 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -80,8 +80,12 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) vtkFloatingPointType aLength = aDataSet->GetLength(); vtkFloatingPointType aPrecision = 1.0E-3; vtkFloatingPointType anOldScale = GetScale()[0]; - vtkFloatingPointType aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1])); - if(aScale != 0.0 && fabs(aScale - anOldScale)/aScale > aPrecision){ + vtkFloatingPointType aScale; + if (aSize[1] > aSize[0]) + aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1])); + else + aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[1])/vtkFloatingPointType(aSize[0])); + if(aScale != 0.0&& fabs(aScale - anOldScale)/aScale > aPrecision){ SetScale(aScale); } } -- 2.39.2