mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-03 03:11:57 +00:00
perf(l2): no redraws while nothing changes
Found by counting flushes on idle screens in the sim: - The compose field's cursor blinked (a redraw every 400 ms) as soon as a conversation opened, the keyboard hidden: lv_keyboard_set_textarea() focuses the field, and LVGL only stops a blink when the cursor moves. fieldFocus() sets the state and nudges the blink; also used for the WiFi and channel fields, which left theirs running. - lv_obj_align_to() restyles on every call, so the status bar's icons redrew every second; placeLeftOf() moves them only when they move. - Text colours set every second (nav bar, GPS status, Diag errors) go through setTextColor(), which skips an unchanged colour. - A LV_LABEL_LONG_DOT label writes its "..." into its own text, so setText() never matched and rewrote it every refresh (the nav bar's hint); labelShows() reads past the dots. - The map area, the area-outline, trail and vector-label layers were invalidated on every map refresh (every 3 s, a full-map redraw); now only when the view or what they draw changed. Idle map: 17 -> 1 flush in 5 s; list and settings screens: 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -721,8 +721,7 @@ void UITask::homeMapLayout() {
|
||||
int shown = 0;
|
||||
char sl[16];
|
||||
double lat = atan(sinh(M_PI * (1 - 2 * s_cy / (double)n))) * 180.0 / M_PI;
|
||||
s_grid = { left, top, mapview::gridStep(s_z, lat, _prefs && _prefs->units_imperial, 48, sl, sizeof(sl)) };
|
||||
lv_obj_invalidate(s_area);
|
||||
mapview::setGrid(s_area, s_grid, left, top, mapview::gridStep(s_z, lat, _prefs && _prefs->units_imperial, 48, sl, sizeof(sl)));
|
||||
bool tiled = true;
|
||||
for (int j = 0; j < ROWS; j++) {
|
||||
for (int i = 0; i < COLS; i++) {
|
||||
|
||||
Reference in New Issue
Block a user