fix(color): Lua LVGL line color not set correctly when 'pts' property is a function (#6270)
This commit is contained in:
@@ -800,11 +800,16 @@ bool LvglWidgetLine::callRefs(lua_State *L)
|
|||||||
int t = lua_gettop(L);
|
int t = lua_gettop(L);
|
||||||
if (getPointsFunction != LUA_REFNIL) {
|
if (getPointsFunction != LUA_REFNIL) {
|
||||||
if (pcallFunc(L, getPointsFunction, 1)) {
|
if (pcallFunc(L, getPointsFunction, 1)) {
|
||||||
|
bool firstPts = (pts == nullptr);
|
||||||
uint32_t h = getPts(L);
|
uint32_t h = getPts(L);
|
||||||
if (h != ptsHash) {
|
if (h != ptsHash) {
|
||||||
ptsHash = h;
|
ptsHash = h;
|
||||||
setLine();
|
setLine();
|
||||||
}
|
}
|
||||||
|
if (firstPts) {
|
||||||
|
setColor(color.flags);
|
||||||
|
setOpacity(opacity.value);
|
||||||
|
}
|
||||||
lua_settop(L, t);
|
lua_settop(L, t);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user