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

Method setValue

src/fl/ui/slider.cpp.hpp:15–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15void UISlider::setValue(float value) FL_NOEXCEPT {
16 float oldValue = mImpl.value();
17 mImpl.setValue(value);
18 // Read back post-clamp value; only fire callbacks if the observable value
19 // actually changed (avoids spurious notifications when caller passes an
20 // out-of-range value that clamps back to the current value).
21 float newValue = mImpl.value();
22 if (newValue != oldValue) {
23 mLastFrameValue = newValue;
24 mLastFrameValueValid = true;
25 // Invoke callbacks to notify listeners (including JavaScript components)
26 mCallbacks.invoke(*this);
27 }
28}
29
30void UISlider::Listener::onBeginFrame() FL_NOEXCEPT {
31 UISlider &owner = *mOwner;

Callers 1

loopFunction · 0.45

Calls 2

valueMethod · 0.45
invokeMethod · 0.45

Tested by 1

loopFunction · 0.36