From bbee6e96057e2af16245e38c098bf57c16b79e89 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 21 Dec 2023 16:09:45 -0500 Subject: [PATCH] update animating logic --- src/viewport.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/viewport.js b/src/viewport.js index 3bd51ac8..543d7871 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -1153,18 +1153,16 @@ $.Viewport.prototype = { this.degreesSpring.update(); } - - var changed = this.centerSpringX.current.value !== this._oldCenterX || - this.centerSpringY.current.value !== this._oldCenterY || - this.zoomSpring.current.value !== this._oldZoom || - this.degreesSpring.current.value !== this._oldDegrees; - - this._oldCenterX = this.centerSpringX.current.value; this._oldCenterY = this.centerSpringY.current.value; this._oldZoom = this.zoomSpring.current.value; this._oldDegrees = this.degreesSpring.current.value; + var changed = !this.zoomSpring.isAtTargetValue() || + !this.centerSpringX.isAtTargetValue() || + !this.centerSpringY.isAtTargetValue() || + !this.degreesSpring.isAtTargetValue(); + return changed; },