mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Slider: Ensure that current Value is always treated as a double
This commit is contained in:
parent
05c2261efe
commit
7f0a305199
1 changed files with 4 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue