From 0ef7360e9abc74a93e2940f4c4dce1f92198ca35 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 15 Aug 2021 15:00:54 -0400 Subject: [PATCH] Try fixing the moving rainbow red purple glitch --- src/pattern/moving_rainbow.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pattern/moving_rainbow.rs b/src/pattern/moving_rainbow.rs index 26af0fa..8e8c54f 100644 --- a/src/pattern/moving_rainbow.rs +++ b/src/pattern/moving_rainbow.rs @@ -41,6 +41,8 @@ impl Pattern for MovingRainbow { // RAINBOW.len() * width let length_factor = u16::try_from(RAINBOW.len()) .or(Err(()))? + .checked_add(self.skip.into()) + .ok_or(())? .saturating_mul(u16::from(self.width)); // The length of the buffer // Always a factor of length_factor