mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
Merge pull request #63 from InventivetalentDev/master
Fixes & variable scroll speed
This commit is contained in:
17856
build/litegraph.js
17856
build/litegraph.js
File diff suppressed because it is too large
Load Diff
9278
build/litegraph.min.js
vendored
9278
build/litegraph.min.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -2653,7 +2653,7 @@ LGraphNode.prototype.computeSize = function( minHeight, out )
|
||||
* Allows to pass
|
||||
*
|
||||
* @method addWidget
|
||||
* @return {Float32Array[4]} the total size
|
||||
* @return {Object} the created widget
|
||||
*/
|
||||
LGraphNode.prototype.addWidget = function( type, name, value, callback, options )
|
||||
{
|
||||
@@ -4094,7 +4094,7 @@ LGraphCanvas.prototype.processMouseDown = function(e)
|
||||
{
|
||||
//double click node
|
||||
if( node.onDblClick)
|
||||
node.onDblClick(e,[e.canvasX - node.pos[0], e.canvasY - node.pos[1]],graphcanvas);
|
||||
node.onDblClick(e,[e.canvasX - node.pos[0], e.canvasY - node.pos[1]], this);
|
||||
this.processNodeDblClicked( node );
|
||||
block_drag_node = true;
|
||||
}
|
||||
@@ -8002,11 +8002,14 @@ function ContextMenu( values, options )
|
||||
function on_mouse_wheel(e)
|
||||
{
|
||||
var pos = parseInt( root.style.top );
|
||||
root.style.top = (pos + e.deltaY * 0.1).toFixed() + "px";
|
||||
root.style.top = (pos + e.deltaY * options.scroll_speed).toFixed() + "px";
|
||||
e.preventDefault();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!options.scroll_speed)
|
||||
options.scroll_speed = 0.1;
|
||||
|
||||
root.addEventListener("wheel", on_mouse_wheel, true);
|
||||
root.addEventListener("mousewheel", on_mouse_wheel, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user