X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FOpenGl%2FOpenGl_BVHTreeSelector.cxx;h=95edcad41fda1443319cb0ffd2de0d116c551bf9;hb=d918208af6aa2917817c1ddf82057d4bd391ad8b;hpb=98ae54f728a7ed99c2b4e4d5fc06488a3ccb2ddd diff --git a/src/OpenGl/OpenGl_BVHTreeSelector.cxx b/src/OpenGl/OpenGl_BVHTreeSelector.cxx index a3bcd1edd3..95edcad41f 100644 --- a/src/OpenGl/OpenGl_BVHTreeSelector.cxx +++ b/src/OpenGl/OpenGl_BVHTreeSelector.cxx @@ -96,10 +96,10 @@ void OpenGl_BVHTreeSelector::SetViewportSize (Standard_Integer theViewportWidth, Standard_Integer theViewportHeight, Standard_Real theResolutionRatio) { - myViewportHeight = theViewportHeight; - myViewportWidth = theViewportWidth; - myPixelSize = Max (theResolutionRatio / theViewportHeight, - theResolutionRatio / theViewportWidth); + myViewportHeight = theViewportHeight > 0 ? theViewportHeight : 1; + myViewportWidth = theViewportWidth > 0 ? theViewportWidth : 1; + myPixelSize = Max (theResolutionRatio / myViewportHeight, + theResolutionRatio / myViewportWidth); } // =======================================================================