chore(color): color UI code cleanup - round 3 (#5351)

This commit is contained in:
philmoz
2024-08-01 10:05:52 +10:00
committed by GitHub
parent a362feed91
commit 23df4f63bb
104 changed files with 554 additions and 824 deletions
+2 -2
View File
@@ -555,9 +555,9 @@ static int luaModelSetFlightMode(lua_State * L)
if (idx < 0 || idx >= max_trims) continue;
int16_t val = luaL_checkinteger(L, -1);
if (g_model.extendedTrims)
val = limit<int16_t>(val, TRIM_EXTENDED_MIN, TRIM_EXTENDED_MAX);
val = limit<int16_t>(TRIM_EXTENDED_MIN, val, TRIM_EXTENDED_MAX);
else
val = limit<int16_t>(val, TRIM_MIN, TRIM_MAX);
val = limit<int16_t>(TRIM_MIN, val, TRIM_MAX);
if (idx < max_trims)
fm->trim[idx].value = val;
}
+2 -11
View File
@@ -200,13 +200,8 @@ void LuaWidget::redraw_cb(lv_event_t* e)
} else {
lv_draw_ctx_t* draw_ctx = lv_event_get_draw_ctx(e);
lv_area_t a, clipping, obj_coords;
lv_area_copy(&a, draw_ctx->buf_area);
lv_area_copy(&clipping, draw_ctx->clip_area);
lv_obj_get_coords(target, &obj_coords);
auto w = a.x2 - a.x1 + 1;
auto h = a.y2 - a.y1 + 1;
auto w = draw_ctx->buf_area->x2 - draw_ctx->buf_area->x1 + 1;
auto h = draw_ctx->buf_area->y2 - draw_ctx->buf_area->y1 + 1;
TRACE_WINDOWS("Draw %s", widget->getWindowDebugString().c_str());
@@ -215,10 +210,6 @@ void LuaWidget::redraw_cb(lv_event_t* e)
buf.setDrawCtx(draw_ctx);
buf.setOffset(obj_coords.x1 - a.x1, obj_coords.y1 - a.y1);
buf.setClippingRect(clipping.x1 - a.x1, clipping.x2 + 1 - a.x1,
clipping.y1 - a.y1, clipping.y2 + 1 - a.y1);
widget->refresh(&buf);
}
}