diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index a67a38eb33..ecf27e04de 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -386,25 +386,25 @@ void SceneWidget::settingChanged (const CSMPrefs::Setting *setting) void RenderWidget::updateCameraParameters(double overrideAspect) { - const float near = 1.0; - const float far = 1000.0; + const float nearDist = 1.0; + const float farDist = 1000.0; if (CSMPrefs::get()["Rendering"]["camera-ortho"].isTrue()) { const float size = CSMPrefs::get()["Rendering"]["camera-ortho-size"].toDouble(); const float aspect = overrideAspect >= 0.0 ? overrideAspect : (width() / static_cast(height())); - const float half_h = size * 10.0; - const float half_w = half_h * aspect; + const float halfH = size * 10.0; + const float halfW = halfH * aspect; mView->getCamera()->setProjectionMatrixAsOrtho( - -half_w, half_w, -half_h, half_h, near, far); + -halfW, halfW, -halfH, halfH, nearDist, farDist); } else { mView->getCamera()->setProjectionMatrixAsPerspective( CSMPrefs::get()["Rendering"]["camera-fov"].toDouble(), static_cast(width())/static_cast(height()), - near, far); + nearDist, farDist); } }