Skip to content

Commit

Permalink
fix(potetiometer): visual glitch #133
Browse files Browse the repository at this point in the history
  • Loading branch information
urish committed Jul 23, 2022
1 parent 86a4357 commit 381cd4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/potentiometer-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ interface Point {
functions are taken from https://github.com/vitaliy-bobrov/js-rocks knob component */
@customElement('wokwi-potentiometer')
export class PotentiometerElement extends LitElement {
@property() min = 0;
@property() max = 100;
@property({ type: Number }) min = 0;
@property({ type: Number }) max = 100;
@property() value = 0;
@property() step = 1;
@property() startDegree = -135;
Expand Down Expand Up @@ -209,7 +209,7 @@ export class PotentiometerElement extends LitElement {
const y = this.center.y - pageY;
let deg = Math.round((Math.atan2(y, x) * 180) / Math.PI);

if (deg < 0) {
if (deg <= 0) {
deg += 360;
}

Expand Down

0 comments on commit 381cd4f

Please sign in to comment.