mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-28 18:54:09 +00:00
[CodeHealth] Apply modern standards to LGraphCanvas (#650)
- Prefer template string - Prefer explicit throw to undefined TypeError - Remove unnecessary `this` assignment
This commit is contained in:
@@ -77,12 +77,9 @@ export class SliderWidget extends BaseWidget implements ISliderWidget {
|
||||
if (show_text) {
|
||||
ctx.textAlign = "center"
|
||||
ctx.fillStyle = this.text_color
|
||||
const fixedValue = Number(this.value).toFixed(this.options.precision ?? 3)
|
||||
ctx.fillText(
|
||||
(this.label || this.name) +
|
||||
" " +
|
||||
Number(this.value).toFixed(
|
||||
this.options.precision != null ? this.options.precision : 3,
|
||||
),
|
||||
`${this.label || this.name} ${fixedValue}`,
|
||||
widget_width * 0.5,
|
||||
y + H * 0.7,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user