MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / CompareWithContextState

Method CompareWithContextState

KBotExt/imgui/imgui.cpp:9356–9376  ·  view source on GitHub ↗

Compare to detect usage errors

Source from the content-addressed store, hash-verified

9354
9355// Compare to detect usage errors
9356void ImGuiStackSizes::CompareWithContextState(ImGuiContext* ctx)
9357{
9358 ImGuiContext& g = *ctx;
9359 ImGuiWindow* window = g.CurrentWindow;
9360 IM_UNUSED(window);
9361
9362 // Window stacks
9363 // NOT checking: DC.ItemWidth, DC.TextWrapPos (per window) to allow user to conveniently push once and not pop (they are cleared on Begin)
9364 IM_ASSERT(SizeOfIDStack == window->IDStack.Size && "PushID/PopID or TreeNode/TreePop Mismatch!");
9365
9366 // Global stacks
9367 // For color, style and font stacks there is an incentive to use Push/Begin/Pop/.../End patterns, so we relax our checks a little to allow them.
9368 IM_ASSERT(SizeOfGroupStack == g.GroupStack.Size && "BeginGroup/EndGroup Mismatch!");
9369 IM_ASSERT(SizeOfBeginPopupStack == g.BeginPopupStack.Size && "BeginPopup/EndPopup or BeginMenu/EndMenu Mismatch!");
9370 IM_ASSERT(SizeOfDisabledStack == g.DisabledStackSize && "BeginDisabled/EndDisabled Mismatch!");
9371 IM_ASSERT(SizeOfItemFlagsStack >= g.ItemFlagsStack.Size && "PushItemFlag/PopItemFlag Mismatch!");
9372 IM_ASSERT(SizeOfColorStack >= g.ColorStack.Size && "PushStyleColor/PopStyleColor Mismatch!");
9373 IM_ASSERT(SizeOfStyleVarStack >= g.StyleVarStack.Size && "PushStyleVar/PopStyleVar Mismatch!");
9374 IM_ASSERT(SizeOfFontStack >= g.FontStack.Size && "PushFont/PopFont Mismatch!");
9375 IM_ASSERT(SizeOfFocusScopeStack == g.FocusScopeStack.Size && "PushFocusScope/PopFocusScope Mismatch!");
9376}
9377
9378//-----------------------------------------------------------------------------
9379// [SECTION] LAYOUT

Callers 1

EndMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected