Merge branch 'master' into docking

# Conflicts:
#	imgui.cpp
#	imgui_widgets.cpp
This commit is contained in:
ocornut
2021-03-31 16:41:17 +02:00
15 changed files with 148 additions and 71 deletions

View File

@ -2089,6 +2089,7 @@ static const char* ImAtoi(const char* src, TYPE* output)
// - stb_sprintf.h supports several new modifiers which format numbers in a way that also makes them incompatible atof/atoi.
static void SanitizeFormatString(const char* fmt, char* fmt_out, size_t fmt_out_size)
{
IM_UNUSED(fmt_out_size);
const char* fmt_end = ImParseFormatFindEnd(fmt);
IM_ASSERT((size_t)(fmt_end - fmt + 1) < fmt_out_size); // Format is too long, let us know if this happens to you!
while (fmt < fmt_end)
@ -4814,7 +4815,8 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
char* p = buf;
while (*p == '#' || ImCharIsBlankA(*p))
p++;
i[0] = i[1] = i[2] = i[3] = 0;
i[0] = i[1] = i[2] = 0;
i[3] = 0xFF; // alpha default to 255 is not parsed by scanf (e.g. inputting #FFFFFF omitting alpha)
if (alpha)
sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2], (unsigned int*)&i[3]); // Treat at unsigned (%X is unsigned)
else