Display true values in plot ranges, not animation values.

This commit is contained in:
Bartosz Taudul 2022-06-19 00:39:14 +02:00
parent 331f18345f
commit 2f6399a4b2
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -6716,6 +6716,9 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
max++; max++;
} }
const auto rMin = min;
const auto rMax = max;
auto pvit = m_plotView.find( v ); auto pvit = m_plotView.find( v );
if( pvit == m_plotView.end() ) if( pvit == m_plotView.end() )
{ {
@ -6838,13 +6841,13 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
if( yPos + ty >= yMin && yPos <= yMax ) if( yPos + ty >= yMin && yPos <= yMax )
{ {
char tmp[64]; char tmp[64];
sprintf( tmp, "(y-range: %s, visible data points: %s)", FormatPlotValue( max - min, v->format ), RealToString( num ) ); sprintf( tmp, "(y-range: %s, visible data points: %s)", FormatPlotValue( rMax - rMin, v->format ), RealToString( num ) );
draw->AddText( wpos + ImVec2( ty * 1.5f + txtx, offset - ty ), 0x8844DDDD, tmp ); draw->AddText( wpos + ImVec2( ty * 1.5f + txtx, offset - ty ), 0x8844DDDD, tmp );
} }
auto tmp = FormatPlotValue( max, v->format ); auto tmp = FormatPlotValue( rMax, v->format );
DrawTextContrast( draw, wpos + ImVec2( 0, offset ), 0x8844DDDD, tmp ); DrawTextContrast( draw, wpos + ImVec2( 0, offset ), 0x8844DDDD, tmp );
offset += PlotHeight - ty; offset += PlotHeight - ty;
tmp = FormatPlotValue( min, v->format ); tmp = FormatPlotValue( rMin, v->format );
DrawTextContrast( draw, wpos + ImVec2( 0, offset ), 0x8844DDDD, tmp ); DrawTextContrast( draw, wpos + ImVec2( 0, offset ), 0x8844DDDD, tmp );
DrawLine( draw, dpos + ImVec2( 0, offset + ty - 1 ), dpos + ImVec2( w, offset + ty - 1 ), 0x8844DDDD ); DrawLine( draw, dpos + ImVec2( 0, offset + ty - 1 ), dpos + ImVec2( w, offset + ty - 1 ), 0x8844DDDD );