Commit b9d349bd authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Draw selection boxes only as large as the items



Change-Id: I0f7f4f2a73c24faeff9c502b118e984938a27d25
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent 6d5cf83a
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment