FastLED 3.9.15
Loading...
Searching...
No Matches

◆ FL_DISABLE_WARNING()

FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING ( float- equal)

Definition at line 6 of file slider.cpp.hpp.

8 {
9
10UISlider::UISlider(const char *name, float value, float min, float max, float step) FL_NOEXCEPT
11 : mImpl(name, value, min, max, step), mListener(this) {
12 mListener.addToEngineEventsOnce();
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;
32 if (!owner.mLastFrameValueValid) {
33 owner.mLastFrameValue = owner.value();
34 owner.mLastFrameValueValid = true;
35 return;
36 }
37 float value = owner.value();
38 if (value != owner.mLastFrameValue) {
39 owner.mCallbacks.invoke(*mOwner);
40 owner.mLastFrameValue = value;
41 }
42}
43
44} // namespace fl
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Memory functions are available in fl:: namespace via fl/stl/cstring.h Using declarations cannot work ...
Definition math.h:71
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75
#define FL_NOEXCEPT

References FL_NOEXCEPT, max(), min(), fl::UISlider::Listener::onBeginFrame(), fl::UISlider::setValue(), fl::step(), and fl::type_rank< T >::value.

+ Here is the call graph for this function: