From d3554084add9b58dd73c883d28f5dfbbf6b04827 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 20 Sep 2014 13:50:23 +0200 Subject: [PATCH] Fix weird behaviour of options menu sliders when value was changed out of bounds via cfg file --- apps/openmw/mwgui/settingswindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index c3fbe88abe..7c530034d5 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -136,6 +136,7 @@ namespace MWGui float min,max; getSettingMinMax(scroll, min, max); float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current)); + value = std::max(min, std::min(value, max)); value = (value-min)/(max-min); scroll->setScrollPosition( value * (scroll->getScrollRange()-1));