From 47522f47054d33178e7defa780042bd2a06b09f9 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 22 Jan 2025 12:23:03 +0100 Subject: [PATCH] Fix build for removal of ImGuiColorEditFlags_AlphaPreview in IMGUI_VERSION_NUM=19173 Only necessary when using IMGUI_DISABLE_OBSOLETE_FUNCTIONS. --- implot.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/implot.cpp b/implot.cpp index 68addd4..fd3690d 100644 --- a/implot.cpp +++ b/implot.cpp @@ -5005,9 +5005,15 @@ void ShowStyleEditor(ImPlotStyle* ref) { filter.Draw("Filter colors", ImGui::GetFontSize() * 16); static ImGuiColorEditFlags alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; +#if IMGUI_VERSION_NUM < 19173 if (ImGui::RadioButton("Opaque", alpha_flags == ImGuiColorEditFlags_None)) { alpha_flags = ImGuiColorEditFlags_None; } ImGui::SameLine(); if (ImGui::RadioButton("Alpha", alpha_flags == ImGuiColorEditFlags_AlphaPreview)) { alpha_flags = ImGuiColorEditFlags_AlphaPreview; } ImGui::SameLine(); if (ImGui::RadioButton("Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::SameLine(); +#else + if (ImGui::RadioButton("Opaque", alpha_flags == ImGuiColorEditFlags_AlphaOpaque)) { alpha_flags = ImGuiColorEditFlags_AlphaOpaque; } ImGui::SameLine(); + if (ImGui::RadioButton("Alpha", alpha_flags == ImGuiColorEditFlags_None)) { alpha_flags = ImGuiColorEditFlags_None; } ImGui::SameLine(); + if (ImGui::RadioButton("Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::SameLine(); +#endif HelpMarker( "In the color list:\n" "Left-click on colored square to open color picker,\n"