| 3116 | } |
| 3117 | |
| 3118 | void PopStyleVar(int count) { |
| 3119 | ImPlot3DContext& gp = *GImPlot3D; |
| 3120 | IM_ASSERT_USER_ERROR(count <= gp.StyleModifiers.Size, "You can't pop more modifiers than have been pushed!"); |
| 3121 | while (count > 0) { |
| 3122 | ImGuiStyleMod& backup = gp.StyleModifiers.back(); |
| 3123 | const ImPlot3DStyleVarInfo* info = GetPlotStyleVarInfo(backup.VarIdx); |
| 3124 | void* data = info->GetVarPtr(&gp.Style); |
| 3125 | if (info->Type == ImGuiDataType_Float && info->Count == 1) { |
| 3126 | ((float*)data)[0] = backup.BackupFloat[0]; |
| 3127 | } else if (info->Type == ImGuiDataType_Float && info->Count == 2) { |
| 3128 | ((float*)data)[0] = backup.BackupFloat[0]; |
| 3129 | ((float*)data)[1] = backup.BackupFloat[1]; |
| 3130 | } else if (info->Type == ImGuiDataType_S32 && info->Count == 1) { |
| 3131 | ((int*)data)[0] = backup.BackupInt[0]; |
| 3132 | } |
| 3133 | gp.StyleModifiers.pop_back(); |
| 3134 | count--; |
| 3135 | } |
| 3136 | } |
| 3137 | |
| 3138 | ImVec4 GetStyleColorVec4(ImPlot3DCol idx) { return IsColorAuto(idx) ? GetAutoColor(idx) : GImPlot3D->Style.Colors[idx]; } |
| 3139 |
no test coverage detected