QmlProfiler: Constrain the length of painted events to the visible area

When overpainting, some note markers won't be visible.

Change-Id: I7888d43e8b1e3503b7a90e773e9c8138b70070f0
Task-number: QTCREATORBUG-13534
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-11-26 18:56:18 +01:00
parent d36c4d87db
commit 7659159017

View File

@@ -130,8 +130,8 @@ inline void TimelineRenderer::getItemXExtent(int modelIndex, int i, int &current
if (rawWidth < MinimumItemWidth) { if (rawWidth < MinimumItemWidth) {
currentX -= static_cast<int>((MinimumItemWidth - rawWidth) / 2); currentX -= static_cast<int>((MinimumItemWidth - rawWidth) / 2);
itemWidth = MinimumItemWidth; itemWidth = MinimumItemWidth;
} else if (rawWidth > m_spacedDuration) { } else if (rawWidth > m_spacedDuration - static_cast<qreal>(currentX - OutOfScreenMargin)) {
itemWidth = static_cast<int>(m_spacedDuration); itemWidth = static_cast<int>(m_spacedDuration) - currentX + OutOfScreenMargin;
} else { } else {
itemWidth = static_cast<int>(rawWidth); itemWidth = static_cast<int>(rawWidth);
} }