From 8286ec81316894e81613e549ff561a21ebcff2f5 Mon Sep 17 00:00:00 2001 From: dimitrieh Date: Tue, 30 Sep 2025 13:43:36 +0200 Subject: [PATCH] Remove animation from zoom buttons for instant, smooth zooming Replace animatedZoomView() with direct zoomView() calls for zoom buttons and keyboard shortcuts to eliminate jagged animation caused by redraw() being called on every frame. - Change zoomIn/zoomOut/zoomZero to use instant zoom like trackpad - Single redraw per zoom step instead of 8-10 redraws during animation - Makes all zoom methods (buttons, keyboard, trackpad) feel consistent - Keep animatedZoomView() only for zoomToFitAll() where animation helps Fixes stuttering when zooming with buttons or Ctrl+/-/0 shortcuts. --- .../node_modules/@node-red/editor-client/src/js/ui/view.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index 607a67681..e71993663 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -2847,16 +2847,16 @@ RED.view = (function() { function zoomIn(focalPoint) { if (scaleFactor < RED.view.zoomConstants.MAX_ZOOM) { - animatedZoomView(scaleFactor + RED.view.zoomConstants.ZOOM_STEP, focalPoint); + zoomView(scaleFactor + RED.view.zoomConstants.ZOOM_STEP, focalPoint); } } function zoomOut(focalPoint) { var minZoom = calculateMinZoom(); if (scaleFactor > minZoom) { - animatedZoomView(Math.max(scaleFactor - RED.view.zoomConstants.ZOOM_STEP, minZoom), focalPoint); + zoomView(Math.max(scaleFactor - RED.view.zoomConstants.ZOOM_STEP, minZoom), focalPoint); } } - function zoomZero() { animatedZoomView(1); } + function zoomZero() { zoomView(1); } function zoomToFitAll() { // Get all nodes in active workspace