From 02349afe8b748e089e8a5a872deeda16f3231138 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Thu, 1 Dec 2016 21:52:29 +0300 Subject: [PATCH] (EasyGraphicsView) Fixed timeline scale indicator text; * (EasyGraphicsView) Fixed longest thread selection; --- profiler_gui/blocks_graphics_view.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/profiler_gui/blocks_graphics_view.cpp b/profiler_gui/blocks_graphics_view.cpp index a30ab04..b0971b2 100644 --- a/profiler_gui/blocks_graphics_view.cpp +++ b/profiler_gui/blocks_graphics_view.cpp @@ -244,7 +244,7 @@ void EasyTimelineIndicatorItem::paint(QPainter* _painter, const QStyleOptionGrap const auto sceneView = static_cast(scene()->parent()); const auto visibleSceneRect = sceneView->visibleSceneRect(); const auto step = sceneView->timelineStep() * sceneView->scale(); - const QString text = ::profiler_gui::timeStringInt(EASY_GLOBALS.time_units, units2microseconds(sceneView->timelineStep())); // Displayed text + const QString text = ::profiler_gui::autoTimeStringInt(units2microseconds(sceneView->timelineStep())); // Displayed text // Draw scale indicator _painter->save(); @@ -392,7 +392,7 @@ void EasyGraphicsView::setTree(const ::profiler::thread_blocks_tree_t& _blocksTr // calculate scene size and fill it with items // Calculating start and end time - ::profiler::timestamp_t finish = 0; + ::profiler::timestamp_t finish = 0, busyTime = 0; ::profiler::thread_id_t longestTree = 0, mainTree = 0; for (const auto& threadTree : _blocksTree) { @@ -414,8 +414,11 @@ void EasyGraphicsView::setTree(const ::profiler::thread_blocks_tree_t& _blocksTr if (m_beginTime > timestart) m_beginTime = timestart; - if (finish < timefinish) { + if (finish < timefinish) finish = timefinish; + + if (t.active_time > busyTime) { + busyTime = t.active_time; longestTree = threadTree.first; }