Sfoglia il codice sorgente

Fixed old Begin() calling SetNextWindowBgAlpha() with negative values. (#1567, #1568)

omar 7 anni fa
parent
commit
5148937d4d
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      imgui.cpp

+ 2 - 1
imgui.cpp

@@ -5018,7 +5018,8 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_first_use,
         ImGui::SetNextWindowSize(size_first_use, ImGuiCond_FirstUseEver);
         ImGui::SetNextWindowSize(size_first_use, ImGuiCond_FirstUseEver);
 
 
     // Old API feature: override the window background alpha with a parameter.
     // Old API feature: override the window background alpha with a parameter.
-    ImGui::SetNextWindowBgAlpha(bg_alpha_override);
+    if (bg_alpha_override >= 0.0f)
+        ImGui::SetNextWindowBgAlpha(bg_alpha_override);
 
 
     return ImGui::Begin(name, p_open, flags);
     return ImGui::Begin(name, p_open, flags);
 }
 }