Allow decimal slider steps (#8501)

This commit is contained in:
Bram Kragten 2021-03-01 18:41:36 +01:00 committed by GitHub
parent 5ff757ad65
commit 4765114e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,7 +80,11 @@ class HaSlider extends PaperSliderClass {
}
_setImmediateValue(newImmediateValue) {
super._setImmediateValue(Math.round(newImmediateValue));
super._setImmediateValue(
this.step >= 1
? Math.round(newImmediateValue)
: Math.round(newImmediateValue * 100) / 100
);
}
_calcStep(value) {