mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-29 03:26:38 +00:00 
			
		
		
		
	Fix weird behaviour of options menu sliders when value was changed out of bounds via cfg file
This commit is contained in:
		
							parent
							
								
									dec9ffdb6c
								
							
						
					
					
						commit
						d3554084ad
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -136,6 +136,7 @@ namespace MWGui | ||||||
|                     float min,max; |                     float min,max; | ||||||
|                     getSettingMinMax(scroll, min, max); |                     getSettingMinMax(scroll, min, max); | ||||||
|                     float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current)); |                     float value = Settings::Manager::getFloat(getSettingName(current), getSettingCategory(current)); | ||||||
|  |                     value = std::max(min, std::min(value, max)); | ||||||
|                     value = (value-min)/(max-min); |                     value = (value-min)/(max-min); | ||||||
| 
 | 
 | ||||||
|                     scroll->setScrollPosition( value * (scroll->getScrollRange()-1)); |                     scroll->setScrollPosition( value * (scroll->getScrollRange()-1)); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue