mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 09:14:25 +00:00
Expose zoom speed option (#19)
* Expose zoom speed option * Avoid unnecessary operations
This commit is contained in:
@@ -5180,6 +5180,7 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
|
||||
this.ds = new DragAndScale();
|
||||
this.zoom_modify_alpha = true; //otherwise it generates ugly patterns when scaling down too much
|
||||
this.zoom_speed = 1.1 // in range (1.01, 2.5). Less than 1 will invert the zoom direction
|
||||
|
||||
this.title_text_font = "" + LiteGraph.NODE_TEXT_SIZE + "px Arial";
|
||||
this.inner_text_font =
|
||||
@@ -6899,9 +6900,9 @@ LGraphNode.prototype.executeAction = function(action)
|
||||
var scale = this.ds.scale;
|
||||
|
||||
if (delta > 0) {
|
||||
scale *= 1.1;
|
||||
scale *= this.zoom_speed;
|
||||
} else if (delta < 0) {
|
||||
scale *= 1 / 1.1;
|
||||
scale *= 1 / this.zoom_speed;
|
||||
}
|
||||
|
||||
//this.setZoom( scale, [ e.clientX, e.clientY ] );
|
||||
|
||||
Reference in New Issue
Block a user