From 94b42da80ae5f364b8d5fd31d01e5ee349040f3c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 13 May 2015 18:23:38 +0200 Subject: Timeline: Make 0-width events visible again. Events with duration == 0 were erroneously filtered out by the items render pass. Also, we have to give them a very small width in order for the "stretching" mechanism in the vertex shader to work. Change-Id: Icb76168f0831547a3ca55ab79df7161736ed4dc4 Task-number: QTCREATORBUG-14446 Reviewed-by: Eike Ziller Reviewed-by: Joerg Bornemann --- src/libs/timeline/timelineitemsrenderpass.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libs/timeline/timelineitemsrenderpass.cpp') diff --git a/src/libs/timeline/timelineitemsrenderpass.cpp b/src/libs/timeline/timelineitemsrenderpass.cpp index 41f0a362cd..114cd5983a 100644 --- a/src/libs/timeline/timelineitemsrenderpass.cpp +++ b/src/libs/timeline/timelineitemsrenderpass.cpp @@ -202,7 +202,7 @@ static void updateNodes(int from, int to, const TimelineModel *model, for (int i = from; i < to; ++i) { qint64 start = qMax(parentState->start(), model->startTime(i)); qint64 end = qMin(parentState->end(), model->startTime(i) + model->duration(i)); - if (start >= end) + if (start > end) continue; float itemTop = (1.0 - model->relativeHeight(i)) * defaultRowHeight; @@ -230,7 +230,7 @@ static void updateNodes(int from, int to, const TimelineModel *model, for (int i = from; i < to; ++i) { qint64 start = qMax(parentState->start(), model->startTime(i)); qint64 end = qMin(parentState->end(), model->startTime(i) + model->duration(i)); - if (start >= end) + if (start > end) continue; QColor color = model->color(i); @@ -238,7 +238,8 @@ static void updateNodes(int from, int to, const TimelineModel *model, uchar green = color.green(); uchar blue = color.blue(); - float itemWidth = (end - start) * parentState->scale(); + float itemWidth = end > start ? (end - start) * parentState->scale() : + std::numeric_limits::min(); float itemLeft = (start - parentState->start()) * parentState->scale(); // This has to be the exact same expression as above, to guarantee determinism. -- cgit v1.2.1