ImGui: Added FindContainerByName() helper (#7313)

Added a helper function to find a container by name in the histogram container.

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
monroegm-disable-blank-issue-2
Benjamin Jillich 4 years ago committed by GitHub
parent d6c419d630
commit 5e85e0e397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,6 +36,8 @@ namespace ImGui::LYImGuiUtils
void SetHistogramBinCount(int count) { m_histogramBinCount = count; }
ImGui::LYImGuiUtils::HistogramContainer* FindContainerByName(const char* name);
//! Needs to be public for l-value access for ImGui::MenuItem()
bool m_show = true;

@ -77,6 +77,17 @@ namespace ImGui::LYImGuiUtils
}
}
}
ImGui::LYImGuiUtils::HistogramContainer* HistogramGroup::FindContainerByName(const char* name)
{
const auto iterator = m_histogramIndexByName.find(name);
if (iterator != m_histogramIndexByName.end())
{
return &m_histograms[iterator->second];
}
return nullptr;
}
} // namespace ImGui::LYImGuiUtils
#endif // IMGUI_ENABLED

Loading…
Cancel
Save