From 7dc24f14ed421bc21ae1ca8e2f98b7e5b4c946a5 Mon Sep 17 00:00:00 2001 From: omar abdelzaher sleam Date: Tue, 4 Apr 2023 17:20:09 +0000 Subject: [PATCH] try solve the numbers equations --- src/litegraph.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/litegraph.js b/src/litegraph.js index bc1a34e86..b90de11ed 100644 --- a/src/litegraph.js +++ b/src/litegraph.js @@ -9985,6 +9985,10 @@ LGraphNode.prototype.executeAction = function(action) var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0; if (event.click_time < 200 && delta == 0) { this.prompt("Value",w.value,function(v) { + try {//solve the equation if possible + v = eval(v); + } catch (error) { + } this.value = Number(v); inner_value_change(this, this.value); }.bind(w),