mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-30 20:51:06 +01:00 
			
		
		
		
	Apply fix from data_types branch, some widgets broken when format string doesn't contains a %. Broken by 92f0165f85. Data_types branch fix c5fb929555.
				
					
				
			This commit is contained in:
		| @@ -8681,6 +8681,9 @@ static float GetMinimumStepAtDecimalPrecision(int decimal_precision) | ||||
|  | ||||
| float ImGui::RoundScalarWithFormat(const char* format, float value) | ||||
| { | ||||
|     const char* fmt_start = ParseFormatTrimDecorationsLeading(format); | ||||
|     if (fmt_start[0] != '%' || fmt_start[1] == '%') // Don't apply if the value is not visible in the format string | ||||
|         return value; | ||||
|     char buf[64]; | ||||
|     ImFormatString(buf, IM_ARRAYSIZE(buf), ParseFormatTrimDecorationsLeading(format), value); | ||||
|     return (float)atof(buf); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user