| 3033 | } |
| 3034 | |
| 3035 | void 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 | |
| 3056 | const char* ImGui::GetStyleColorName(ImGuiCol idx) |
| 3057 | { |
nothing calls this directly
no test coverage detected