Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3558,6 +3558,13 @@ void HideNextItem(bool hidden, ImPlotCond cond) {
gp.NextItemData.HiddenCond = cond;
}

bool GetLastItemHidden() {
ImPlotContext& gp = *GImPlot;
if (gp.PreviousItem)
return !gp.PreviousItem->Show;
return false;
}

//-----------------------------------------------------------------------------
// [SECTION] Plot Tools
//-----------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions implot.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,8 @@ IMPLOT_API void CancelPlotSelection();
// Hides or shows the next plot item (i.e. as if it were toggled from the legend).
// Use ImPlotCond_Always if you need to forcefully set this every frame.
IMPLOT_API void HideNextItem(bool hidden = true, ImPlotCond cond = ImPlotCond_Once);
// Returns true if the last plot item was hidden
IMPLOT_API bool GetLastItemHidden();

// Use the following around calls to Begin/EndPlot to align l/r/t/b padding.
// Consider using Begin/EndSubplots first. They are more feature rich and
Expand Down