forked from qt-creator/qt-creator
QmlProfiler: Increase minimum size of timeline items to 3px
One pixel wide lines are too hard to spot. Change-Id: I94f71ba4305078d8682673618be0f5a5e1f85ba8 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -109,16 +109,20 @@ inline void TimelineRenderer::getItemXExtent(int modelIndex, int i, int ¤t
|
||||
qint64 start = m_profilerModelProxy->startTime(modelIndex, i) - m_startTime;
|
||||
if (start > 0) {
|
||||
currentX = start * m_spacing;
|
||||
itemWidth = qMax(1.0, (qMin(m_profilerModelProxy->duration(modelIndex, i) *
|
||||
m_spacing, m_spacedDuration)));
|
||||
itemWidth = m_profilerModelProxy->duration(modelIndex, i) * m_spacing;
|
||||
} else {
|
||||
currentX = -OutOfScreenMargin;
|
||||
// Explicitly round the "start" part down, away from 0, to match the implicit rounding of
|
||||
// currentX in the > 0 case. If we don't do that we get glitches where a pixel is added if
|
||||
// the element starts outside the screen and subtracted if it starts inside the screen.
|
||||
itemWidth = qMax(1.0, (qMin(m_profilerModelProxy->duration(modelIndex, i) * m_spacing +
|
||||
floor(start * m_spacing) + OutOfScreenMargin,
|
||||
m_spacedDuration)));
|
||||
itemWidth = m_profilerModelProxy->duration(modelIndex, i) * m_spacing +
|
||||
floor(start * m_spacing) + OutOfScreenMargin;
|
||||
}
|
||||
if (itemWidth < MinimumItemWidth) {
|
||||
currentX -= (MinimumItemWidth - itemWidth) / 2;
|
||||
itemWidth = MinimumItemWidth;
|
||||
} else if (itemWidth > m_spacedDuration) {
|
||||
itemWidth = m_spacedDuration;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user