]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_29Jul08)
authorvsr <vsr@opencascade.com>
Tue, 29 Jul 2008 10:29:47 +0000 (10:29 +0000)
committervsr <vsr@opencascade.com>
Tue, 29 Jul 2008 10:29:47 +0000 (10:29 +0000)
src/VTKViewer/VTKViewer_Trihedron.cxx

index d9f5d3321d71e11149d14ac0f801d7bc9409ade4..7781f1b579707eb3b3e34350e8c34652968ece92 100755 (executable)
@@ -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);
     }
   }