Try fixing the moving rainbow red purple glitch

This commit is contained in:
Austen Adler 2021-08-15 15:00:54 -04:00
parent 709ce60b6d
commit 0ef7360e9a

View File

@ -41,6 +41,8 @@ impl Pattern for MovingRainbow {
// RAINBOW.len() * width // RAINBOW.len() * width
let length_factor = u16::try_from(RAINBOW.len()) let length_factor = u16::try_from(RAINBOW.len())
.or(Err(()))? .or(Err(()))?
.checked_add(self.skip.into())
.ok_or(())?
.saturating_mul(u16::from(self.width)); .saturating_mul(u16::from(self.width));
// The length of the buffer // The length of the buffer
// Always a factor of length_factor // Always a factor of length_factor