MCPcopy Create free account
hub / github.com/FastLED/FastLED / onBeginFrame

Method onBeginFrame

src/fl/ui/dropdown.cpp.hpp:18–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16UIDropdown::~UIDropdown() FL_NOEXCEPT {}
17
18void UIDropdown::Listener::onBeginFrame() FL_NOEXCEPT {
19 UIDropdown &owner = *mOwner;
20
21 // Seed baseline before any first-frame advance so a nextOption() triggered
22 // on the very first frame still produces a change callback.
23 if (!owner.mLastFrameValueValid) {
24 owner.mLastFrameValue = owner.as_int();
25 owner.mLastFrameValueValid = true;
26 }
27
28 // Check the next button if one is attached (via IButtonInput interface)
29 if (owner.mNextButton && owner.mNextButton->clicked()) {
30 owner.nextOption();
31 }
32
33 int value = owner.as_int();
34 if (value != owner.mLastFrameValue) {
35 owner.mCallbacks.invoke(owner);
36 owner.mLastFrameValue = value;
37 }
38}
39
40} // namespace fl

Callers

nothing calls this directly

Calls 4

nextOptionMethod · 0.80
as_intMethod · 0.45
clickedMethod · 0.45
invokeMethod · 0.45

Tested by

no test coverage detected