From 2de0a07cd4b59416d0318a5952f5f5594955dd10 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 4 Aug 2026 14:33:31 +0200 Subject: [PATCH] Fixed PVS Studio false positive. --- imgui.cpp | 2 +- imgui_draw.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 2eee9d87f..e8b16a7fa 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -8228,7 +8228,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) // Set default BgClickFlags // This is set at the end of this function, so UpdateWindowManualResize()/ClampWindowPos() may use last-frame value if overridden by user code. // FIXME: The general intent is that we will later expose config options to default to enable scrolling + select scrolling mouse button. - window->BgClickFlags = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window->BgClickFlags : (g.IO.ConfigWindowsMoveFromTitleBarOnly ? ImGuiWindowBgClickFlags_None : ImGuiWindowBgClickFlags_Move); + window->BgClickFlags = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window->BgClickFlags : (g.IO.ConfigWindowsMoveFromTitleBarOnly ? ImGuiWindowBgClickFlags_None : ImGuiWindowBgClickFlags_Move); // -V1004 // We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin(). // This is useful to allow creating context menus on title bar only, etc. diff --git a/imgui_draw.cpp b/imgui_draw.cpp index a9759c072..35ac29f47 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -722,6 +722,7 @@ void ImDrawList::_SetTexture(ImTextureRef tex_ref) void ImDrawList::_SetPixelDensity(float pixel_density) { + IM_ASSERT(pixel_density > 0.0f); _FringeScale = 1.0f / pixel_density; _InvFringeScale = pixel_density; }