From f6fcd6e16eceb4f5192cdadacc6fd5219ce81de0 Mon Sep 17 00:00:00 2001 From: Patrick Custer Date: Mon, 18 Aug 2025 10:33:38 -0400 Subject: [PATCH 1/3] limit updates on zoom and camera move to only once --- js/models/event_handler.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/models/event_handler.js b/js/models/event_handler.js index 9a8e2a00..f606d52e 100644 --- a/js/models/event_handler.js +++ b/js/models/event_handler.js @@ -94,6 +94,11 @@ export default class EventHandler { return; } jsTargetLock.lock(); + + if (this.aladin.view.dragging) { + return; + } + const raDec = [position.ra, position.dec]; this.updateWCS(); this.model.set("_target", `${raDec[0]} ${raDec[1]}`); @@ -122,6 +127,12 @@ export default class EventHandler { } jsFovLock.lock(); // fov MUST be cast into float in order to be sent to the model + + const zoom = this.aladin.view.zoom; + if (zoom.isZooming && fov != zoom.finalZoom) { + return; + } + this.updateWCS(); this.update2AxisFoV(); this.model.set("_fov", parseFloat(fov.toFixed(5))); From fd08fbdec2d916ad7d0c164890c9719aae8aa793 Mon Sep 17 00:00:00 2001 From: Patrick Custer Date: Mon, 18 Aug 2025 10:34:21 -0400 Subject: [PATCH 2/3] remove broken update to rotation --- js/models/event_handler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/models/event_handler.js b/js/models/event_handler.js index f606d52e..e276c75b 100644 --- a/js/models/event_handler.js +++ b/js/models/event_handler.js @@ -160,7 +160,6 @@ export default class EventHandler { /* Rotation control */ this.model.on("change:_rotation", () => { - this.updateRotation(this.model.get("_rotation"), this.aladinDiv); // Update WCS and FoV only if this is the last div this.updateWCS(); this.update2AxisFoV(); From 3600459b252dabcd8042bfb1f11b16215f85d55d Mon Sep 17 00:00:00 2001 From: Patrick Custer Date: Mon, 18 Aug 2025 10:36:46 -0400 Subject: [PATCH 3/3] remove zeroing out of wcs and fov_xy in rotation update --- src/ipyaladin/widget.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ipyaladin/widget.py b/src/ipyaladin/widget.py index 0b340014..ede60b95 100644 --- a/src/ipyaladin/widget.py +++ b/src/ipyaladin/widget.py @@ -345,8 +345,6 @@ def rotation(self, rotation: Union[float, Angle]) -> None: rotation = rotation.deg if np.isclose(self._rotation, rotation): return - self._wcs = {} - self._fov_xy = {} self._rotation = rotation self.send({"event_name": "change_rotation", "rotation": rotation})