From a3fe8ebb18b217673472220a5994f704b692ea54 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 18 Dec 2001 11:28:44 +0000 Subject: [PATCH] Added range checking to osg::Camera::adjustAspectRatio to catch invalid values being passed to Camera. Invalid values were occuring when iconising the Windows GLUT based OSG demos. --- src/osg/Camera.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osg/Camera.cpp b/src/osg/Camera.cpp index 90fd0387b..c6230b305 100644 --- a/src/osg/Camera.cpp +++ b/src/osg/Camera.cpp @@ -218,6 +218,12 @@ void Camera::setNearFar(const double zNear, const double zFar) * Typicall used after resizeing a window.*/ void Camera::adjustAspectRatio(const double newAspectRatio, const AdjustAspectRatioMode aa) { + if (newAspectRatio<0.01f || newAspectRatio>100.0f) + { + notify(NOTICE)<<"Warning: aspect ratio out of range (0.01..100) in Camera::adjustAspectRatio("<