fix(lua): lcd.drawGauge wide gauge error (#2375)

This commit is contained in:
Gábor Bányász
2022-09-27 12:03:53 +10:00
committed by GitHub
parent af7679a486
commit 8ad390d59b
+1 -1
View File
@@ -954,7 +954,7 @@ static int luaLcdDrawGauge(lua_State *L)
flags = flagsRGB(flags);
luaLcdBuffer->drawRect(x, y, w, h, 1, 0xff, flags);
uint8_t len = limit((uint8_t)1, uint8_t(w*num/den), uint8_t(w));
uint16_t len = limit((uint16_t)1, uint16_t(w*num/den), uint16_t(w));
luaLcdBuffer->drawSolidFilledRect(x+1, y+1, len, h-2, flags);
return 0;