Skip to content

Commit

Permalink
TextUpdate: Consider widget value if no PV value
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Sep 19, 2023
1 parent a0911ef commit 5072413
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/widgets/monitors/TextUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ export class TextUpdate extends Widget {
}

let text = this.text;
if (this.pv && this.pv.value !== undefined) {
if (this.pv?.value !== undefined) {
const precision = this.precisionFromPV
? this.pv.precision
: this.precision;
text = this.pv.formatValue(this.formatType, precision);
} else if (this.value !== undefined) {
text = this.value;
}
ctx.fillText(text, x, y);
}
Expand Down

0 comments on commit 5072413

Please sign in to comment.