MCPcopy Create free account
hub / github.com/brenocq/implot3d / PopStyleVar

Function PopStyleVar

implot3d.cpp:3118–3136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3116}
3117
3118void 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
3138ImVec4 GetStyleColorVec4(ImPlot3DCol idx) { return IsColorAuto(idx) ? GetAutoColor(idx) : GImPlot3D->Style.Colors[idx]; }
3139

Callers 5

ShowLegendContextMenuFunction · 0.85
ColormapSliderFunction · 0.85
ShowMetricsWindowMethod · 0.85
ColormapButtonFunction · 0.85
ShowStyleEditorFunction · 0.85

Calls 2

GetPlotStyleVarInfoFunction · 0.85
GetVarPtrMethod · 0.80

Tested by

no test coverage detected