From 848c251c9a9a4cca744c71c586ae4d9254098099 Mon Sep 17 00:00:00 2001 From: Aghasi Poghosyan Date: Sun, 4 Feb 2024 12:58:12 +0400 Subject: [PATCH] Fix mouse and trackpad zoom behavior * make zoom behavior smooth and friendly --- web/lib/litegraph.core.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/web/lib/litegraph.core.js b/web/lib/litegraph.core.js index 4aae889ef4e..382786b1581 100644 --- a/web/lib/litegraph.core.js +++ b/web/lib/litegraph.core.js @@ -6913,11 +6913,7 @@ LGraphNode.prototype.executeAction = function(action) var scale = this.ds.scale; - if (delta > 0) { - scale *= 1.1; - } else if (delta < 0) { - scale *= 1 / 1.1; - } + scale *= Math.pow(1.4, delta * 0.01); //this.setZoom( scale, [ e.clientX, e.clientY ] ); this.ds.changeScale(scale, [e.clientX, e.clientY]);