mirror of https://github.com/node-red/node-red.git
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.pull/5312/head
parent
f74beb6a92
commit
8286ec8131
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue