mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-22 15:29:44 +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
|
* Allows to pass
|
||||||
*
|
*
|
||||||
* @method addWidget
|
* @method addWidget
|
||||||
* @return {Float32Array[4]} the total size
|
* @return {Object} the created widget
|
||||||
*/
|
*/
|
||||||
LGraphNode.prototype.addWidget = function( type, name, value, callback, options )
|
LGraphNode.prototype.addWidget = function( type, name, value, callback, options )
|
||||||
{
|
{
|
||||||
@@ -4094,7 +4094,7 @@ LGraphCanvas.prototype.processMouseDown = function(e)
|
|||||||
{
|
{
|
||||||
//double click node
|
//double click node
|
||||||
if( node.onDblClick)
|
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 );
|
this.processNodeDblClicked( node );
|
||||||
block_drag_node = true;
|
block_drag_node = true;
|
||||||
}
|
}
|
||||||
@@ -8002,11 +8002,14 @@ function ContextMenu( values, options )
|
|||||||
function on_mouse_wheel(e)
|
function on_mouse_wheel(e)
|
||||||
{
|
{
|
||||||
var pos = parseInt( root.style.top );
|
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();
|
e.preventDefault();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!options.scroll_speed)
|
||||||
|
options.scroll_speed = 0.1;
|
||||||
|
|
||||||
root.addEventListener("wheel", on_mouse_wheel, true);
|
root.addEventListener("wheel", on_mouse_wheel, true);
|
||||||
root.addEventListener("mousewheel", on_mouse_wheel, true);
|
root.addEventListener("mousewheel", on_mouse_wheel, true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user