diff options
author | Ulf Hermann <[email protected]> | 2016-05-25 19:00:43 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2016-05-27 09:12:53 +0000 |
commit | d984a83611988e1e2fc8a442b909d49f6bed74e2 (patch) | |
tree | 53a57b8b1a7a0082b443a04fb02e57e8c369c612 /src/libs/timeline/timelineitemsrenderpass.cpp | |
parent | 4f9b4b14c15836276a8d5937c2dc7637c376a6aa (diff) |
Timeline: Encode the "stretched" property in "a" rather than "id"
The way it was before, we couldn't have negative ids.
Change-Id: I2ac07295b18020fc1a9357e15739bbf2601d20b6
Reviewed-by: Christian Kandeler <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/libs/timeline/timelineitemsrenderpass.cpp')
-rw-r--r-- | src/libs/timeline/timelineitemsrenderpass.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libs/timeline/timelineitemsrenderpass.cpp b/src/libs/timeline/timelineitemsrenderpass.cpp index 8aa86b7416f..235a3388168 100644 --- a/src/libs/timeline/timelineitemsrenderpass.cpp +++ b/src/libs/timeline/timelineitemsrenderpass.cpp @@ -143,10 +143,8 @@ float OpaqueColoredPoint2DWithSize::top() const void OpaqueColoredPoint2DWithSize::update(float nr, float ny) { - if (id > -1) - id = -2; - else - --id; + if (a <= MaximumDirection) + a += MaximumDirection; y += ny; w = nr - x; @@ -154,13 +152,13 @@ void OpaqueColoredPoint2DWithSize::update(float nr, float ny) OpaqueColoredPoint2DWithSize::Direction OpaqueColoredPoint2DWithSize::direction() const { - return static_cast<Direction>(a); + return static_cast<Direction>(a > MaximumDirection ? a - MaximumDirection : a); } void OpaqueColoredPoint2DWithSize::setCommon(const OpaqueColoredPoint2DWithSize *master) { a = 255; - if (master->id < 0) { + if (master->a > MaximumDirection) { id = std::numeric_limits<float>::lowest(); r = g = b = 128; } else { |