MCPcopy Create free account
hub / github.com/SatDump/SatDump / SetupLegend

Function SetupLegend

src-core/imgui/implot/implot.cpp:2306–2321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2304}
2305
2306void SetupLegend(ImPlotLocation location, ImPlotLegendFlags flags) {
2307 ImPlotContext& gp = *GImPlot;
2308 IM_ASSERT_USER_ERROR((gp.CurrentPlot != nullptr && !gp.CurrentPlot->SetupLocked) || (gp.CurrentSubplot != nullptr && gp.CurrentPlot == nullptr),
2309 "Setup needs to be called after BeginPlot or BeginSubplots and before any setup locking functions (e.g. PlotX)!");
2310 if (gp.CurrentItems) {
2311 ImPlotLegend& legend = gp.CurrentItems->Legend;
2312 // check and set location
2313 if (location != legend.PreviousLocation)
2314 legend.Location = location;
2315 legend.PreviousLocation = location;
2316 // check and set flags
2317 if (flags != legend.PreviousFlags)
2318 legend.Flags = flags;
2319 legend.PreviousFlags = flags;
2320 }
2321}
2322
2323void SetupMouseText(ImPlotLocation location, ImPlotMouseTextFlags flags) {
2324 ImPlotContext& gp = *GImPlot;

Callers 4

Demo_BarGroupsFunction · 0.85
Demo_BarStacksFunction · 0.85
Demo_SubplotItemSharingFunction · 0.85
Demo_LegendOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected