fix rounding in ws2812:buffer:mix

This commit is contained in:
Gregor 2019-07-14 21:48:07 +02:00
parent 0398c3360b
commit bd0549ac4a
1 changed files with 1 additions and 0 deletions

View File

@ -425,6 +425,7 @@ static int ws2812_buffer_mix(lua_State* L) {
val += (int32_t)(source[src].values[i] * source[src].factor);
}
val += 128; // rounding istead of floor
val >>= 8;
if (val < 0) {