Add sanity check for viewport resolution scale to avoid negative value

This commit is contained in:
Sam Gateau 2019-06-25 11:54:50 -07:00
parent 9470467c31
commit 768dd051aa

View file

@ -159,6 +159,10 @@ void RenderScriptingInterface::setViewportResolutionScale(float scale) {
} }
void RenderScriptingInterface::forceViewportResolutionScale(float scale) { void RenderScriptingInterface::forceViewportResolutionScale(float scale) {
// just not negative values or zero
if (scale <= 0.f) {
return;
}
_renderSettingLock.withWriteLock([&] { _renderSettingLock.withWriteLock([&] {
_viewportResolutionScale = (scale); _viewportResolutionScale = (scale);
_viewportResolutionScaleSetting.set(scale); _viewportResolutionScaleSetting.set(scale);