Fix widget buttons registering clicks twice

This commit is contained in:
RobTheFiveNine
2021-06-15 14:37:17 +01:00
parent 40907189f3
commit d0eedf7232
7 changed files with 63 additions and 67 deletions

View File

@@ -8853,16 +8853,15 @@ LGraphNode.prototype.executeAction = function(action)
//inside widget
switch (w.type) {
case "button":
if (event.type === "mousemove") {
break;
}
if (w.callback) {
setTimeout(function() {
w.callback(w, that, node, pos, event);
}, 20);
}
w.clicked = true;
this.dirty_canvas = true;
if (event.type === "mousedown") {
if (w.callback) {
setTimeout(function() {
w.callback(w, that, node, pos, event);
}, 20);
}
w.clicked = true;
this.dirty_canvas = true;
}
break;
case "slider":
var range = w.options.max - w.options.min;