]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Bug IPAL20057 Incorrect big size of trihedron arrows and letters when vertical size...
authordmv <dmv@opencascade.com>
Tue, 8 Jul 2008 13:11:42 +0000 (13:11 +0000)
committerdmv <dmv@opencascade.com>
Tue, 8 Jul 2008 13:11:42 +0000 (13:11 +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);
     }
   }