From 38611876ac1eb0b4c2976f9c922d97563074ebdd Mon Sep 17 00:00:00 2001
From: Catalin Mititiuc
Date: Thu, 20 Mar 2025 13:46:22 -0700
Subject: Add transition for programmatic zoom
---
src/modules/zoom.js | 2 ++
1 file changed, 2 insertions(+)
(limited to 'src')
diff --git a/src/modules/zoom.js b/src/modules/zoom.js
index 3ccb918..1dad8a6 100644
--- a/src/modules/zoom.js
+++ b/src/modules/zoom.js
@@ -35,7 +35,9 @@ export function programmaticZoom(el, point, scale, cb) {
const computedMtx = getComputedTransformMatrix(el);
const translateMtx = getTranslateMatrix(el, point.x, point.y);
+ el.style.transition = 'transform 0.5s';
setTransform(el, computedMtx, translateMtx, scale);
+ el.addEventListener('transitionend', () => el.style.transition = '', { once: true });
cb();
}
--
cgit v1.2.3