| 2304 | } |
| 2305 | |
| 2306 | void 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 | |
| 2323 | void SetupMouseText(ImPlotLocation location, ImPlotMouseTextFlags flags) { |
| 2324 | ImPlotContext& gp = *GImPlot; |
no outgoing calls
no test coverage detected