fix(color): widgets may not update correctly when flight mode changes (v2) (#6639)

This commit is contained in:
philmoz
2025-10-08 20:48:43 +10:00
committed by GitHub
parent 98c1732453
commit 2976fde8db
2 changed files with 4 additions and 3 deletions
@@ -98,8 +98,9 @@ rect_t Layout::getZone(unsigned int index) const
void Layout::checkEvents()
{
Window::checkEvents();
if (lastFM != mixerCurrentFlightMode) {
lastFM = mixerCurrentFlightMode;
rect_t z = getMainZone();
if (z.x != lastMainZone.x || z.y != lastMainZone.y || z.w != lastMainZone.w || z.h != lastMainZone.h) {
lastMainZone = z;
updateZones();
}
}
@@ -113,7 +113,7 @@ class Layout: public LayoutBase
std::unique_ptr<ViewMainDecoration> decoration;
uint8_t zoneCount;
uint8_t* zoneMap = nullptr;
uint8_t lastFM = 0;
rect_t lastMainZone = {0,0,0,0};
// Last time we refreshed the window
uint32_t lastRefresh = 0;