mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-20 06:58:08 +01:00
feat(temperatureDragger): fix rendering issues
This commit is contained in:
parent
43e0e184e0
commit
5d8769205c
2 changed files with 4 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
|
|||
|
||||
@Input() min: number = 0; // min output value
|
||||
@Input() max: number = 100; // max output value
|
||||
@Input() step = 0.1;
|
||||
|
||||
@Output() power = new EventEmitter<boolean>();
|
||||
|
||||
|
|
@ -345,7 +346,7 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
|
|||
}
|
||||
|
||||
private toValueNumber(factor) {
|
||||
return factor * (this.max - this.min) + this.min;
|
||||
return Math.round(factor * (this.max - this.min) / this.step) * this.step + this.min;
|
||||
}
|
||||
|
||||
private static toRad(angle) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue