Merge pull request #416 from Pax1601/385-setting-altitude-to-silly-number

Fixed wrong callback call from slider
This commit is contained in:
Pax1601 2023-09-30 19:27:33 +02:00 committed by GitHub
commit 691d2746e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,14 +63,12 @@ export class Slider extends Control {
setValue(newValue: number, ignoreExpectedValue: boolean = true) {
if (!this.getDragged() && (ignoreExpectedValue || this.checkExpectedValue(newValue))) {
if (this.#value !== newValue) {
if (this.#value !== newValue)
this.#value = newValue;
if (this.#callback)
this.#callback(this.getValue());
}
if (this.#slider != null)
this.#slider.value = String((newValue - this.#minValue) / (this.#maxValue - this.#minValue) * parseFloat(this.#slider.max));
this.#update();
}
}