mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Store min, max values in plot.
This commit is contained in:
parent
5deb1c51dd
commit
591fbdf75a
@ -854,12 +854,16 @@ void View::InsertPlot( PlotData* plot, int64_t time, double val )
|
||||
{
|
||||
if( plot->data.empty() || plot->data.back().time < time )
|
||||
{
|
||||
plot->min = val;
|
||||
plot->max = val;
|
||||
plot->data.emplace_back( PlotItem { time, val } );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( plot->min > val ) plot->min = val;
|
||||
else if( plot->max < val ) plot->max = val;
|
||||
auto it = std::lower_bound( plot->data.begin(), plot->data.end(), time, [] ( const auto& lhs, const auto& rhs ) { return lhs.time < rhs; } );
|
||||
it = plot->data.insert( it, PlotItem { time, val } );
|
||||
plot->data.insert( it, PlotItem { time, val } );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,8 @@ private:
|
||||
struct PlotData
|
||||
{
|
||||
uint64_t name;
|
||||
double min;
|
||||
double max;
|
||||
std::vector<PlotItem> data;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user