0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 08:41:02 +08:00

(GUI) Hystogram painting improvement

This commit is contained in:
Victor Zarubkin 2016-12-27 20:53:16 +03:00
parent 31f3bf142b
commit b3045c1b68

View File

@ -520,10 +520,15 @@ void EasyHystogramItem::paintById(QPainter* _painter)
} }
else else
{ {
first = items.begin() + items.size() - 1; first = items.begin() + (items.size() - 1);
} }
const auto n = static_cast<uint32_t>(::std::distance(first, items.end())); auto last = ::std::upper_bound(first, items.end(), maximum + EASY_GLOBALS.begin_time, [](qreal _value, ::profiler::block_index_t _item)
{
return _value < easyBlock(_item).tree.node->begin();
});
const auto n = static_cast<uint32_t>(::std::distance(first, last));
if (n > 0) if (n > 0)
{ {