From 69f524ba959c694a304dd71765d84e1422ce1eb2 Mon Sep 17 00:00:00 2001 From: ocornut Date: Fri, 8 Dec 2023 18:43:29 +0100 Subject: [PATCH] DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: Added when component <= 0. (#7095) --- imgui.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui.cpp b/imgui.cpp index 4bfe45c1f..10ccf0222 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9860,6 +9860,7 @@ void ImGui::PushMultiItemsWidths(int components, float w_full) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; + IM_ASSERT(components > 0); const ImGuiStyle& style = g.Style; const float w_item_one = ImMax(1.0f, IM_TRUNC((w_full - (style.ItemInnerSpacing.x) * (components - 1)) / (float)components)); const float w_item_last = ImMax(1.0f, IM_TRUNC(w_full - (w_item_one + style.ItemInnerSpacing.x) * (components - 1)));