From 7675df60bab0f9e4a384ffc774903a8deb3b9673 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 29 Sep 2014 08:17:51 +1000 Subject: [PATCH] Fix far clip distance (again), workaround for broken settings minimum value. --- apps/opencs/model/settings/usersettings.cpp | 5 ++++- apps/opencs/view/render/scenewidget.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/settings/usersettings.cpp b/apps/opencs/model/settings/usersettings.cpp index 156bff22a..11fdc54f4 100644 --- a/apps/opencs/model/settings/usersettings.cpp +++ b/apps/opencs/model/settings/usersettings.cpp @@ -56,7 +56,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() numLights->setDefaultValue(8); numLights->setEditorSetting(true); numLights->setColumnSpan (1); - numLights->setMinimum (2); + numLights->setMinimum (0); numLights->setMaximum (100); // FIXME: not sure what the max value should be numLights->setWidgetWidth (10); numLights->setViewLocation(1, 2); @@ -79,6 +79,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() fastFactor->setEditorSetting(true); fastFactor->setColumnSpan (1); fastFactor->setMinimum (1); + fastFactor->setSpecialValueText ("1"); // FIXME: workaround fastFactor->setMaximum (100); // FIXME: not sure what the max value should be fastFactor->setWidgetWidth (10); fastFactor->setViewLocation(1, 2); @@ -109,6 +110,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() maxSubView->setEditorSetting(true); maxSubView->setColumnSpan (1); maxSubView->setMinimum (1); + maxSubView->setSpecialValueText ("1"); maxSubView->setMaximum (256); // FIXME: not sure what the max value should be maxSubView->setWidgetWidth (10); maxSubView->setViewLocation(1, 2); @@ -118,6 +120,7 @@ void CSMSettings::UserSettings::buildSettingModelDefaults() minWidth->setEditorSetting(true); minWidth->setColumnSpan (1); minWidth->setMinimum (50); + minWidth->setSpecialValueText ("50"); minWidth->setMaximum (10000); // FIXME: not sure what the max value should be minWidth->setWidgetWidth (10); minWidth->setViewLocation(2, 2); diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index 3ca2a171c..2b2c8ade0 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -412,7 +412,7 @@ namespace CSVRender if(key.contains(QRegExp("^\\b(Objects|Shader|Scene)", Qt::CaseInsensitive))) flagAsModified(); - if(key == "Objects/far clip distance" && !list.empty()) + if(key == "Scene/far clip distance" && !list.empty()) { if(mCamera->getFarClipDistance() != list.at(0).toFloat()) mCamera->setFarClipDistance(list.at(0).toFloat());