mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 22:39:39 +00:00
fixes in mouse events
This commit is contained in:
@@ -5798,14 +5798,15 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
var skip_dragging = false;
|
||||
var skip_action = false;
|
||||
var now = LiteGraph.getTime();
|
||||
var is_double_click = (now - this.last_mouseclick < 300) && (e.isPrimary!==undefined && e.isPrimary);
|
||||
var is_primary = (e.isPrimary === undefined || !e.isPrimary);
|
||||
var is_double_click = (now - this.last_mouseclick < 300) && is_primary;
|
||||
this.mouse[0] = e.clientX;
|
||||
this.mouse[1] = e.clientY;
|
||||
this.graph_mouse[0] = e.canvasX;
|
||||
this.graph_mouse[1] = e.canvasY;
|
||||
this.last_click_position = [this.mouse[0],this.mouse[1]];
|
||||
|
||||
if (this.pointer_is_down && e.isPrimary!==undefined && !e.isPrimary){
|
||||
if (this.pointer_is_down && is_primary ){
|
||||
this.pointer_is_double = true;
|
||||
//console.log("pointerevents: pointer_is_double start");
|
||||
}else{
|
||||
@@ -6501,8 +6502,10 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
**/
|
||||
LGraphCanvas.prototype.processMouseUp = function(e) {
|
||||
|
||||
var is_primary = ( e.isPrimary === undefined || e.isPrimary );
|
||||
|
||||
//early exit for extra pointer
|
||||
if(e.isPrimary!==undefined && !e.isPrimary){
|
||||
if(!is_primary){
|
||||
/*e.stopPropagation();
|
||||
e.preventDefault();*/
|
||||
//console.log("pointerevents: processMouseUp pointerN_stop "+e.pointerId+" "+e.isPrimary);
|
||||
@@ -6787,11 +6790,12 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
}
|
||||
|
||||
/*
|
||||
if((this.dirty_canvas || this.dirty_bgcanvas) && this.rendering_timer_id == null)
|
||||
this.draw();
|
||||
*/
|
||||
if((this.dirty_canvas || this.dirty_bgcanvas) && this.rendering_timer_id == null)
|
||||
this.draw();
|
||||
*/
|
||||
|
||||
if (e.isPrimary!==undefined && e.isPrimary){
|
||||
if (is_primary)
|
||||
{
|
||||
this.pointer_is_down = false;
|
||||
this.pointer_is_double = false;
|
||||
}
|
||||
|
||||
@@ -350,4 +350,5 @@
|
||||
};
|
||||
|
||||
LiteGraph.registerNodeType("input/gamepad", GamepadInput);
|
||||
|
||||
})(this);
|
||||
|
||||
Reference in New Issue
Block a user