Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Brückner <marc@ma-br.de>2019-10-19 02:52:17 +0300
committerGitHub <noreply@github.com>2019-10-19 02:52:17 +0300
commitde86febbfc005285b2541b84c035a94c836d2f0d (patch)
tree3e6335c56cb95035576e98b2f82e15af88d9ae7b
parent8b31b643e42d8a53a3df9abc96bf45f00adf52df (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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/pixelset.h b/pixelset.h
index 097df6d6..9c69176e 100644
--- a/pixelset.h
+++ b/pixelset.h
@@ -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; }