diff options
author | Marc Brückner <marc@ma-br.de> | 2019-10-19 02:52:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-19 02:52:17 +0300 |
commit | de86febbfc005285b2541b84c035a94c836d2f0d (patch) | |
tree | 3e6335c56cb95035576e98b2f82e15af88d9ae7b | |
parent | 8b31b643e42d8a53a3df9abc96bf45f00adf52df (diff) |
CPixelView operator-() gives an resulting pixelview pointing to wrong data
In the operator implementation the `leds` pointer is already shifted to the opposite end of the data. Using the constructor with start and end index however does the shift again. A simple fix would be the shift in the operator.
-rw-r--r-- | pixelset.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -64,7 +64,7 @@ public: /// Not sure i want this? inline CPixelView operator()(int end) { return CPixelView(leds, 0, end); } /// Return the reverse ordering of this set - inline CPixelView operator-() { return CPixelView(leds + len - dir, len - dir, 0); } + inline CPixelView operator-() { return CPixelView(leds, len - dir, 0); } /// Return a pointer to the first element in this set inline operator PIXEL_TYPE* () const { return leds; } |