Skip to content

Commit 312de85

Browse files
authored
Merge branch 'comfyanonymous:master' into Main
2 parents 0dcfdc6 + 888173a commit 312de85

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/litegraph.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9735,7 +9735,7 @@ LGraphNode.prototype.executeAction = function(action)
97359735
if (show_text) {
97369736
ctx.textAlign = "center";
97379737
ctx.fillStyle = text_color;
9738-
ctx.fillText(w.name, widget_width * 0.5, y + H * 0.7);
9738+
ctx.fillText(w.label || w.name, widget_width * 0.5, y + H * 0.7);
97399739
}
97409740
break;
97419741
case "toggle":
@@ -9756,8 +9756,9 @@ LGraphNode.prototype.executeAction = function(action)
97569756
ctx.fill();
97579757
if (show_text) {
97589758
ctx.fillStyle = secondary_text_color;
9759-
if (w.name != null) {
9760-
ctx.fillText(w.name, margin * 2, y + H * 0.7);
9759+
const label = w.label || w.name;
9760+
if (label != null) {
9761+
ctx.fillText(label, margin * 2, y + H * 0.7);
97619762
}
97629763
ctx.fillStyle = w.value ? text_color : secondary_text_color;
97639764
ctx.textAlign = "right";
@@ -9792,7 +9793,7 @@ LGraphNode.prototype.executeAction = function(action)
97929793
ctx.textAlign = "center";
97939794
ctx.fillStyle = text_color;
97949795
ctx.fillText(
9795-
w.name + " " + Number(w.value).toFixed(3),
9796+
w.label || w.name + " " + Number(w.value).toFixed(3),
97969797
widget_width * 0.5,
97979798
y + H * 0.7
97989799
);
@@ -9827,7 +9828,7 @@ LGraphNode.prototype.executeAction = function(action)
98279828
ctx.fill();
98289829
}
98299830
ctx.fillStyle = secondary_text_color;
9830-
ctx.fillText(w.name, margin * 2 + 5, y + H * 0.7);
9831+
ctx.fillText(w.label || w.name, margin * 2 + 5, y + H * 0.7);
98319832
ctx.fillStyle = text_color;
98329833
ctx.textAlign = "right";
98339834
if (w.type == "number") {
@@ -9879,8 +9880,9 @@ LGraphNode.prototype.executeAction = function(action)
98799880

98809881
//ctx.stroke();
98819882
ctx.fillStyle = secondary_text_color;
9882-
if (w.name != null) {
9883-
ctx.fillText(w.name, margin * 2, y + H * 0.7);
9883+
const label = w.label || w.name;
9884+
if (label != null) {
9885+
ctx.fillText(label, margin * 2, y + H * 0.7);
98849886
}
98859887
ctx.fillStyle = text_color;
98869888
ctx.textAlign = "right";

0 commit comments

Comments
 (0)