PVS: V560 A part of conditional expression is always true

This commit is contained in:
wmayer
2019-02-17 13:56:48 +01:00
parent 98e13aa048
commit b2a5f47e44
16 changed files with 42 additions and 42 deletions

View File

@@ -521,11 +521,11 @@ void NavigationStyle::boxZoom(const SbBox2s& box)
float scaleX = (float)sizeX/(float)size[0];
float scaleY = (float)sizeY/(float)size[1];
float scale = std::max<float>(scaleX, scaleY);
if (cam && cam->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
if (cam->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
float height = static_cast<SoOrthographicCamera*>(cam)->height.getValue() * scale;
static_cast<SoOrthographicCamera*>(cam)->height = height;
}
else if (cam && cam->getTypeId() == SoPerspectiveCamera::getClassTypeId()) {
else if (cam->getTypeId() == SoPerspectiveCamera::getClassTypeId()) {
float height = static_cast<SoPerspectiveCamera*>(cam)->heightAngle.getValue() / 2.0f;
height = 2.0f * atan(tan(height) * scale);
static_cast<SoPerspectiveCamera*>(cam)->heightAngle = height;