forked from qt-creator/qt-creator
QmlProfiler: Draw selection boxes only as large as the items
Change-Id: I0f7f4f2a73c24faeff9c502b118e984938a27d25 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -189,17 +189,19 @@ void TimelineRenderer::drawSelectionBoxes(QPainter *p, int modelIndex, int fromI
|
|||||||
|
|
||||||
int row = m_profilerModelProxy->getEventRow(modelIndex, i);
|
int row = m_profilerModelProxy->getEventRow(modelIndex, i);
|
||||||
int rowHeight = m_profilerModelProxy->rowHeight(modelIndex, row);
|
int rowHeight = m_profilerModelProxy->rowHeight(modelIndex, row);
|
||||||
|
int itemHeight = rowHeight * m_profilerModelProxy->getHeight(modelIndex, i);
|
||||||
|
|
||||||
currentY = modelRowStart + m_profilerModelProxy->rowOffset(modelIndex, row) - y();
|
currentY = modelRowStart + m_profilerModelProxy->rowOffset(modelIndex, row) + rowHeight -
|
||||||
if (currentY + rowHeight < 0 || height() < currentY)
|
itemHeight - y();
|
||||||
|
if (currentY + itemHeight < 0 || height() < currentY)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
getItemXExtent(modelIndex, i, currentX, itemWidth);
|
getItemXExtent(modelIndex, i, currentX, itemWidth);
|
||||||
|
|
||||||
if (i == m_selectedItem)
|
if (i == m_selectedItem)
|
||||||
selectedItemRect = QRect(currentX, currentY - 1, itemWidth, rowHeight + 1);
|
selectedItemRect = QRect(currentX, currentY - 1, itemWidth, itemHeight + 1);
|
||||||
else
|
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
|
// draw the selected item rectangle the last, so that it's overlayed
|
||||||
|
Reference in New Issue
Block a user