Timeline: Fix event compression for non-default heights

The "id" member of OpaqueColoredPoint2DWithSize is then used as the
number of events compressed into one. To discern it from an actual
id it's also negated. Thus, it needs to be updated when adding an
event. This is not a problem for default height items because their
top is always at 0, so that the addition of the 'y' members doesn't
have an effect.

Change-Id: Ibd7218954e36661d7f729465430de89821a41a7f
Task-number: QTCREATORBUG-16763
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Ulf Hermann
2016-08-22 19:52:20 +02:00
parent f4b8ec1efc
commit 8c80a86266

View File

@@ -143,8 +143,12 @@ float OpaqueColoredPoint2DWithSize::top() const
void OpaqueColoredPoint2DWithSize::update(float nr, float ny)
{
if (a <= MaximumDirection)
if (a <= MaximumDirection) {
a += MaximumDirection;
id = -2;
} else {
--id;
}
y += ny;
w = nr - x;