From b9d349bda5b7b5ecd439652ef4cb6398dc6892bf Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 24 Jun 2014 12:36:23 +0200 Subject: [PATCH] QmlProfiler: Draw selection boxes only as large as the items Change-Id: I0f7f4f2a73c24faeff9c502b118e984938a27d25 Reviewed-by: Kai Koehne --- src/plugins/qmlprofiler/timelinerenderer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmlprofiler/timelinerenderer.cpp b/src/plugins/qmlprofiler/timelinerenderer.cpp index 13d7462ff4f..861dc3ac0d5 100644 --- a/src/plugins/qmlprofiler/timelinerenderer.cpp +++ b/src/plugins/qmlprofiler/timelinerenderer.cpp @@ -189,17 +189,19 @@ void TimelineRenderer::drawSelectionBoxes(QPainter *p, int modelIndex, int fromI int row = m_profilerModelProxy->getEventRow(modelIndex, i); int rowHeight = m_profilerModelProxy->rowHeight(modelIndex, row); + int itemHeight = rowHeight * m_profilerModelProxy->getHeight(modelIndex, i); - currentY = modelRowStart + m_profilerModelProxy->rowOffset(modelIndex, row) - y(); - if (currentY + rowHeight < 0 || height() < currentY) + currentY = modelRowStart + m_profilerModelProxy->rowOffset(modelIndex, row) + rowHeight - + itemHeight - y(); + if (currentY + itemHeight < 0 || height() < currentY) continue; getItemXExtent(modelIndex, i, currentX, itemWidth); if (i == m_selectedItem) - selectedItemRect = QRect(currentX, currentY - 1, itemWidth, rowHeight + 1); + selectedItemRect = QRect(currentX, currentY - 1, itemWidth, itemHeight + 1); else - p->drawRect(currentX, currentY, itemWidth, rowHeight); + p->drawRect(currentX, currentY, itemWidth, itemHeight); } // draw the selected item rectangle the last, so that it's overlayed