Browse Source

Slider: Ensure that current Value is always treated as a double

v6.1.6
reuk 4 years ago
parent
commit
7f0a305199
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      modules/juce_gui_basics/widgets/juce_Slider.cpp

+ 4
- 3
modules/juce_gui_basics/widgets/juce_Slider.cpp View File

@@ -191,9 +191,10 @@ public:
lastCurrentValue = newValue;
// (need to do this comparison because the Value will use equalsWithSameType to compare
// the new and old values, so will generate unwanted change events if the type changes)
if (currentValue != newValue)
// Need to do this comparison because the Value will use equalsWithSameType to compare
// the new and old values, so will generate unwanted change events if the type changes.
// Cast to double before comparing, to prevent comparing as another type (e.g. String).
if (static_cast<double> (currentValue.getValue()) != newValue)
currentValue = newValue;
updateText();


Loading…
Cancel
Save