summaryrefslogtreecommitdiff
path: root/src/libs/timeline/timelineitemsrenderpass.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-13 18:23:38 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-05-18 08:20:43 +0000
commit94b42da80ae5f364b8d5fd31d01e5ee349040f3c (patch)
treef38652e9128bcfbc9e6572a949d934cb170bdbde /src/libs/timeline/timelineitemsrenderpass.cpp
parent59da3a2bba6cc3b8552695d9588dab9b1530cec0 (diff)
downloadqt-creator-94b42da80ae5f364b8d5fd31d01e5ee349040f3c.tar.gz
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 <eike.ziller@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/libs/timeline/timelineitemsrenderpass.cpp')
-rw-r--r--src/libs/timeline/timelineitemsrenderpass.cpp7
1 files changed, 4 insertions, 3 deletions
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<float>::min();
float itemLeft = (start - parentState->start()) * parentState->scale();
// This has to be the exact same expression as above, to guarantee determinism.