updateHandler should look up from the theme, not from base

The `updateHandler` method was looking up colors starting at `theme_base`,
instead of `map_base`. The former is the first theme in our set, the last is the
one we should be working with.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent b6d0197bb4
commit 0b4fb8dc6f

@ -42,10 +42,11 @@ uint16_t LEDPaletteTheme::reserveThemes(uint8_t max_themes) {
void LEDPaletteTheme::updateHandler(uint16_t theme_base, uint8_t theme) { void LEDPaletteTheme::updateHandler(uint16_t theme_base, uint8_t theme) {
uint16_t map_base = theme_base + (theme * ROWS * COLS / 2); uint16_t map_base = theme_base + (theme * ROWS * COLS / 2);
for (uint16_t pos = 0; pos < ROWS * COLS; pos++) { for (uint16_t pos = 0; pos < ROWS * COLS; pos++) {
cRGB color; cRGB color;
if (!lookupColorAtPosition(theme_base, pos, &color)) if (!lookupColorAtPosition(map_base, pos, &color))
continue; continue;
LEDControl.led_set_crgb_at(pos, color); LEDControl.led_set_crgb_at(pos, color);

Loading…
Cancel
Save