From 88126b3c259eb6df03cebe06f3de29793a801b2a Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 20 Aug 2021 20:30:51 +0200 Subject: [PATCH] Fix BeginDisabled(false), (#211, #4452) --- imgui.cpp | 7 ++----- imgui.h | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 354df7e69731..78030ef0e3a3 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6627,12 +6627,9 @@ void ImGui::BeginDisabled(bool disabled) { ImGuiContext& g = *GImGui; bool was_disabled = (g.CurrentItemFlags & ImGuiItemFlags_Disabled) != 0; + g.DisabledAlphaBackup = g.Style.Alpha; if (!was_disabled && disabled) - { - //PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * g.Style.DisabledAlpha); - g.DisabledAlphaBackup = g.Style.Alpha; - g.Style.Alpha *= g.Style.DisabledAlpha; - } + g.Style.Alpha *= g.Style.DisabledAlpha; // PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * g.Style.DisabledAlpha); //PushItemFlag(ImGuiItemFlags_Disabled, was_disabled || disabled); g.CurrentItemFlags |= ImGuiItemFlags_Disabled; g.ItemFlagsStack.push_back(g.CurrentItemFlags); diff --git a/imgui.h b/imgui.h index ff91abde5721..1df673a30a7a 100644 --- a/imgui.h +++ b/imgui.h @@ -61,7 +61,7 @@ Index of this file: // Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) #define IMGUI_VERSION "1.84" -#define IMGUI_VERSION_NUM 18400 +#define IMGUI_VERSION_NUM 18401 #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_HAS_TABLE