From 994114160b62abbbed870fe6c33e9707444f4625 Mon Sep 17 00:00:00 2001 From: Guillaume Faguet Date: Mon, 31 Jul 2023 09:43:58 +0200 Subject: [PATCH 1/3] replacing slider precision harcoded value --- src/litegraph.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 86d58eff5..59b9736de 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -9837,7 +9837,11 @@ LGraphNode.prototype.executeAction = function(action) ctx.textAlign = "center"; ctx.fillStyle = text_color; ctx.fillText( - w.label || w.name + " " + Number(w.value).toFixed(3), + w.label || w.name + " " + Number(w.value).toFixed( + w.options.precision !== undefined + ? w.options.precision + : 3 + ), widget_width * 0.5, y + H * 0.7 ); From 6687056387244567e3b0563c69155ab52c296ae4 Mon Sep 17 00:00:00 2001 From: Guillaume Faguet Date: Mon, 31 Jul 2023 10:18:53 +0200 Subject: [PATCH 2/3] changed precision check from undefined to null --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 59b9736de..6f628123a 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -9838,7 +9838,7 @@ LGraphNode.prototype.executeAction = function(action) ctx.fillStyle = text_color; ctx.fillText( w.label || w.name + " " + Number(w.value).toFixed( - w.options.precision !== undefined + w.options.precision !== null ? w.options.precision : 3 ), From 878500677056c64de9c1cd280c4545f2aa1a0bb1 Mon Sep 17 00:00:00 2001 From: Guillaume Faguet Date: Mon, 31 Jul 2023 11:08:09 +0200 Subject: [PATCH 3/3] typo --- src/litegraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litegraph.js b/src/litegraph.js index 6f628123a..46ba5038d 100755 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -9838,7 +9838,7 @@ LGraphNode.prototype.executeAction = function(action) ctx.fillStyle = text_color; ctx.fillText( w.label || w.name + " " + Number(w.value).toFixed( - w.options.precision !== null + w.options.precision != null ? w.options.precision : 3 ),