MCPcopy Create free account
hub / github.com/RenderKit/embree / PopStyleVar

Method PopStyleVar

tutorials/common/imgui/imgui.cpp:3035–3054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3033}
3034
3035void ImGui::PopStyleVar(int count)
3036{
3037 ImGuiContext& g = *GImGui;
3038 if (g.StyleVarStack.Size < count)
3039 {
3040 IM_ASSERT_USER_ERROR(g.StyleVarStack.Size > count, "Calling PopStyleVar() too many times: stack underflow.");
3041 count = g.StyleVarStack.Size;
3042 }
3043 while (count > 0)
3044 {
3045 // We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it.
3046 ImGuiStyleMod& backup = g.StyleVarStack.back();
3047 const ImGuiStyleVarInfo* info = GetStyleVarInfo(backup.VarIdx);
3048 void* data = info->GetVarPtr(&g.Style);
3049 if (info->Type == ImGuiDataType_Float && info->Count == 1) { ((float*)data)[0] = backup.BackupFloat[0]; }
3050 else if (info->Type == ImGuiDataType_Float && info->Count == 2) { ((float*)data)[0] = backup.BackupFloat[0]; ((float*)data)[1] = backup.BackupFloat[1]; }
3051 g.StyleVarStack.pop_back();
3052 count--;
3053 }
3054}
3055
3056const char* ImGui::GetStyleColorName(ImGuiCol idx)
3057{

Callers

nothing calls this directly

Calls 3

GetStyleVarInfoFunction · 0.85
GetVarPtrMethod · 0.80
pop_backMethod · 0.45

Tested by

no test coverage detected