| 13 | } |
| 14 | |
| 15 | void 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 | |
| 30 | void UISlider::Listener::onBeginFrame() FL_NOEXCEPT { |
| 31 | UISlider &owner = *mOwner; |