diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-05-13 18:23:38 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-05-18 08:20:43 +0000 |
commit | 94b42da80ae5f364b8d5fd31d01e5ee349040f3c (patch) | |
tree | f38652e9128bcfbc9e6572a949d934cb170bdbde /src/libs | |
parent | 59da3a2bba6cc3b8552695d9588dab9b1530cec0 (diff) | |
download | qt-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')
-rw-r--r-- | src/libs/timeline/qml/timelineitems.vert | 2 | ||||
-rw-r--r-- | src/libs/timeline/timelineitemsrenderpass.cpp | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/libs/timeline/qml/timelineitems.vert b/src/libs/timeline/qml/timelineitems.vert index cea5b49cd4..f8cfb40adb 100644 --- a/src/libs/timeline/qml/timelineitems.vert +++ b/src/libs/timeline/qml/timelineitems.vert @@ -48,7 +48,7 @@ void main() // Make very narrow events somewhat wider so that they don't collapse into 0 pixels float scaledWidth = scale.x * rectSize.x; - float shift = sign(scaledWidth) * max(0.0, 3.0 - abs(scaledWidth)) * 0.0005; + float shift = sign(rectSize.x) * max(0.0, 3.0 - abs(scaledWidth)) * 0.0005; gl_Position.x += shift; // Ditto for events with very small height 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. |