Restrict mem events list size.

This commit is contained in:
Bartosz Taudul 2018-05-02 19:40:35 +02:00
parent 867fc6a0cf
commit 7d32ef8c8b

View File

@ -4586,7 +4586,11 @@ void View::DrawStatistics()
template<class T>
void View::ListMemData( T ptr, T end, std::function<const MemEvent*(T&)> DrawAddress )
{
ImGui::BeginChild( "##memScroll", ImVec2( 0, std::max( 200.f, ImGui::GetContentRegionAvail().y ) ) );
const auto& style = ImGui::GetStyle();
const auto dist = std::distance( ptr, end ) + 1;
const auto ty = ImGui::GetTextLineHeight() + style.ItemSpacing.y;
ImGui::BeginChild( "##memScroll", ImVec2( 0, std::max( ty * std::min<int64_t>( dist, 5 ), std::min( ty * dist, ImGui::GetContentRegionAvail().y ) ) ) );
ImGui::Columns( 7 );
ImGui::Text( "Address" );
ImGui::NextColumn();