Fix setting individual LEDs when a specific zone is selected

This commit is contained in:
Adam Honse 2020-03-08 20:51:30 -05:00
parent 5712717ef8
commit 23ad5ca244
3 changed files with 4 additions and 1 deletions

View file

@ -687,6 +687,8 @@ void RGBController::SetupColors()
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
zones[zone_idx].start_idx=total_led_count;
if(colors.size() > 0)
{
zones[zone_idx].colors = &colors[total_led_count];

View file

@ -121,6 +121,7 @@ typedef struct
zone_type type; /* Zone type */
led * leds; /* List of LEDs in zone */
RGBColor * colors; /* Colors of LEDs in zone */
unsigned int start_idx; /* Start index of led/color */
unsigned int leds_count; /* Number of LEDs in zone */
unsigned int leds_min; /* Minimum number of LEDs */
unsigned int leds_max; /* Maximum number of LEDs */

View file

@ -760,7 +760,7 @@ void Ui::OpenRGBDevicePage::on_SetLEDButton_clicked()
{
selected_zone = selected_zone - 1;
device->zones[selected_zone].colors[index] = color;
device->SetLED(device->zones[selected_zone].start_idx + index, color);
}
}
break;