Skip to content

Commit

Permalink
DragScalarN, SliderScalarN, InputScalarN, PushMultiItemsWidths: Added…
Browse files Browse the repository at this point in the history
… when component <= 0. (#7095)
  • Loading branch information
ocornut committed Dec 8, 2023
1 parent 9d8de45 commit 69f524b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down

0 comments on commit 69f524b

Please sign in to comment.