mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 16:30:13 +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
|
|
@ -21,7 +21,8 @@
|
||||||
<g class="toFilter" filter="url(#blurFilter)">
|
<g class="toFilter" filter="url(#blurFilter)">
|
||||||
<path [attr.d]="arc.d" [attr.fill]="arc.color" *ngFor="let arc of styles.gradArcs"></path>
|
<path [attr.d]="arc.d" [attr.fill]="arc.color" *ngFor="let arc of styles.gradArcs"></path>
|
||||||
</g>
|
</g>
|
||||||
<path [attr.d]="styles.nonSelectedArc.d" [attr.fill]="styles.nonSelectedArc.color"></path>
|
<!-- ngFor is a quirk fix for webkit rendering issues -->
|
||||||
|
<path [attr.d]="styles.nonSelectedArc.d" [attr.fill]="styles.nonSelectedArc.color" *ngFor="let number of [0,1,2,3,4,5]"></path>
|
||||||
</g>
|
</g>
|
||||||
|
|
||||||
<circle [attr.cx]="styles.thumbPosition.x" [attr.cy]="styles.thumbPosition.y" [attr.r]="pinRadius"
|
<circle [attr.cx]="styles.thumbPosition.x" [attr.cy]="styles.thumbPosition.y" [attr.r]="pinRadius"
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
|
||||||
|
|
||||||
@Input() min: number = 0; // min output value
|
@Input() min: number = 0; // min output value
|
||||||
@Input() max: number = 100; // max output value
|
@Input() max: number = 100; // max output value
|
||||||
|
@Input() step = 0.1;
|
||||||
|
|
||||||
@Output() power = new EventEmitter<boolean>();
|
@Output() power = new EventEmitter<boolean>();
|
||||||
|
|
||||||
|
|
@ -345,7 +346,7 @@ export class TemperatureDraggerComponent implements AfterViewInit, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
private toValueNumber(factor) {
|
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) {
|
private static toRad(angle) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue