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:
omar 2018-05-08 20:07:25 +02:00
parent 280c05e4f8
commit ad2927888b

View File

@ -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);