History

Add sanity check for viewport resolution scale to avoid negative value

Sam Gateau committed 7 years ago

Commit 768dd051 parent 94704671 file · +4 −0Browse files

Showing the changes to interface/src/scripting/RenderScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/scripting/RenderScriptingInterface.cpp+4−0
@@ -159,6 +159,10 @@ void RenderScriptingInterface::setViewportResolutionScale(float scale) { · 158 unmodified lines
159159 }
160160
161161 void RenderScriptingInterface::forceViewportResolutionScale(float scale) {
162+ // just not negative values or zero
163+ if (scale <= 0.f) {
164+ return;
165+ }
162166 _renderSettingLock.withWriteLock([&] {
163167 _viewportResolutionScale = (scale);
164168 _viewportResolutionScaleSetting.set(scale);