From e19a3a8767cb54218fdf528279a804299213e801 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 3 Sep 2022 19:18:01 +0200 Subject: [PATCH] Implement check for empty plot. --- server/TracyTimelineItemPlot.cpp | 5 +++++ server/TracyTimelineItemPlot.hpp | 1 + 2 files changed, 6 insertions(+) diff --git a/server/TracyTimelineItemPlot.cpp b/server/TracyTimelineItemPlot.cpp index 83c8920f..6d306779 100644 --- a/server/TracyTimelineItemPlot.cpp +++ b/server/TracyTimelineItemPlot.cpp @@ -14,6 +14,11 @@ TimelineItemPlot::TimelineItemPlot( View& view, Worker& worker, PlotData* plot ) { } +bool TimelineItemPlot::IsEmpty() const +{ + return m_plot->data.empty(); +} + const char* TimelineItemPlot::HeaderLabel() const { static char tmp[1024]; diff --git a/server/TracyTimelineItemPlot.hpp b/server/TracyTimelineItemPlot.hpp index 30ebed22..4e3b6e05 100644 --- a/server/TracyTimelineItemPlot.hpp +++ b/server/TracyTimelineItemPlot.hpp @@ -13,6 +13,7 @@ public: TimelineItemPlot( View& view, Worker& worker, PlotData* plot ); void DrawContents( double pxns, int& offset, const ImVec2& wpos, bool hover, float yMin, float yMax ) override; + bool IsEmpty() const override; protected: uint32_t HeaderColor() const override { return 0xFF44DDDD; }