From 479e532f184061fee6af9a295a84bc6f5f263852 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 18 Sep 2017 21:41:49 +0200 Subject: [PATCH] ColorEdit: fixed weird ternary pattern that makes some compiler warning (fair) --- imgui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index a048e64f..0b316c1c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9301,7 +9301,10 @@ static void ColorEditOptionsPopup(ImGuiColorEditFlags flags, float* col) sprintf(buf, "(%d,%d,%d,%d)", cr, cg, cb, ca); if (ImGui::Selectable(buf)) ImGui::SetClipboardText(buf); - sprintf(buf, (flags & ImGuiColorEditFlags_NoAlpha) ? "0x%02X%02X%02X" : "0x%02X%02X%02X%02X", cr, cg, cb, ca); + if (flags & ImGuiColorEditFlags_NoAlpha) + sprintf(buf, "0x%02X%02X%02X", cr, cg, cb); + else + sprintf(buf, "0x%02X%02X%02X%02X", cr, cg, cb, ca); if (ImGui::Selectable(buf)) ImGui::SetClipboardText(buf); ImGui::EndPopup();