From b1dfb4d943f94d8e5051b01f148663031942acd8 Mon Sep 17 00:00:00 2001 From: Maurice Conrad Date: Sun, 14 Apr 2024 14:58:20 +0200 Subject: [PATCH] new wrapper bounds exposed --- playground/src/components/Playground.vue | 9 +++++++++ zoompinch-vue/package.json | 2 +- zoompinch-vue/src/components/Zoompinch.vue | 12 ++++++++++++ zoompinch-vue/src/controllers/zoom.ts | 4 ++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/playground/src/components/Playground.vue b/playground/src/components/Playground.vue index f76161a..8316890 100644 --- a/playground/src/components/Playground.vue +++ b/playground/src/components/Playground.vue @@ -193,6 +193,15 @@ function fit(animate: boolean) { onMounted(() => { setTimeout(() => fit(true)); }); + +watch( + () => zoompinchRef.value?.wrapperBounds, + () => { + requestAnimationFrame(() => { + zoompinchRef.value?.applyTransform(1, [0.5, 0.5], [0.5, 0.5], false); + }); + } +);