mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 03:20:00 +03:00
* By default render OSD element in a single cycle * Use return value of osdDrawSingleElement and double check activeElement.rendered
This commit is contained in:
parent
899ce6731d
commit
1aa71452fb
1 changed files with 9 additions and 8 deletions
|
@ -2128,6 +2128,9 @@ void osdAddActiveElements(void)
|
|||
|
||||
static bool osdDrawSingleElement(displayPort_t *osdDisplayPort, uint8_t item)
|
||||
{
|
||||
// By default mark the element as rendered in case it's in the off blink state
|
||||
activeElement.rendered = true;
|
||||
|
||||
if (!osdElementDrawFunction[item]) {
|
||||
// Element has no drawing function
|
||||
return true;
|
||||
|
@ -2148,7 +2151,6 @@ static bool osdDrawSingleElement(displayPort_t *osdDisplayPort, uint8_t item)
|
|||
activeElement.buff = elementBuff;
|
||||
activeElement.osdDisplayPort = osdDisplayPort;
|
||||
activeElement.drawElement = true;
|
||||
activeElement.rendered = true;
|
||||
activeElement.attr = DISPLAYPORT_SEVERITY_NORMAL;
|
||||
|
||||
// Call the element drawing function
|
||||
|
@ -2272,7 +2274,7 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort)
|
|||
// Only advance to the next element if rendering is complete
|
||||
if (osdDrawSingleElement(osdDisplayPort, item)) {
|
||||
// If rendering is complete then advance to the next element
|
||||
if (activeElement.rendered) {
|
||||
|
||||
// Prepare to render the background of the next element
|
||||
backgroundRendered = false;
|
||||
|
||||
|
@ -2281,7 +2283,6 @@ bool osdDrawNextActiveElement(displayPort_t *osdDisplayPort)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue