From 6ad820a76a5499aeeac34a1321868b45af45f6c8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 23 Mar 2019 02:24:45 +0100 Subject: [PATCH] Display tooltip for plot point over limits. --- server/TracyView.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index aa1ccd9b..e2c95751 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3925,6 +3925,18 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl if( rsz > MaxPoints ) { draw->AddLine( wpos + ImVec2( x1, offset + PlotHeight - ( tmpvec[0] - min ) * revrange * PlotHeight ), wpos + ImVec2( x1, offset + PlotHeight - ( dst[-1] - min ) * revrange * PlotHeight ), 0xFF44DDDD, 4.f ); + + if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( x1 - 2, offset ), wpos + ImVec2( x1 + 2, offset + PlotHeight ) ) ) + { + ImGui::BeginTooltip(); + TextFocused( "Number of values:", RealToString( rsz, true ) ); + TextDisabledUnformatted( "Estimated range:" ); + ImGui::SameLine(); + ImGui::Text( "%s - %s", FormatPlotValue( tmpvec[0], v->type ), FormatPlotValue( dst[-1], v->type ) ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%s)", FormatPlotValue( dst[-1] - tmpvec[0], v->type ) ); + ImGui::EndTooltip(); + } } else {