Skip to content

Commit

Permalink
Fix build for removal of ImGuiColorEditFlags_AlphaPreview in IMGUI_VE…
Browse files Browse the repository at this point in the history
…RSION_NUM=19173

Only necessary when using IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
  • Loading branch information
ocornut committed Jan 22, 2025
1 parent f1b0792 commit 47522f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 47522f4

Please sign in to comment.