From b72bf4fbb377fe5f5213157dad071d95de756248 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 8 Jul 2008 13:11:42 +0000 Subject: [PATCH] Bug IPAL20057 Incorrect big size of trihedron arrows and letters when vertical size of VTK Viewer is small. --- 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