From: vsr Date: Tue, 29 Jul 2008 10:29:47 +0000 (+0000) Subject: merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_29Jul08) X-Git-Tag: TG_TRIPOLI_qt4_porting~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e04ad69f7095687d1f7c05b1dc4efb9170217444;p=modules%2Fgui.git merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_29Jul08) --- 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); } }