From 8d8ef55b81ecbfe8b1fa2a8ee738c7b4952369c1 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Fri, 4 Nov 2022 19:39:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E7=94=BB=E5=B8=83=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=E5=87=BA=E7=8E=B0=E7=9A=84=E4=B8=8D=E5=87=86?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/src/components/ScrollViewer.vue | 9 +++++++++ .../editor/src/layouts/workspace/Stage.vue | 14 ++++++++----- packages/editor/src/utils/scroll-viewer.ts | 20 +++++++++++++++++-- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/packages/editor/src/components/ScrollViewer.vue b/packages/editor/src/components/ScrollViewer.vue index d59dcd4b..a411db29 100644 --- a/packages/editor/src/components/ScrollViewer.vue +++ b/packages/editor/src/components/ScrollViewer.vue @@ -37,6 +37,10 @@ const props = withDefaults( wrapWidth?: number; wrapHeight?: number; zoom?: number; + correctionScrollSize?: { + width: number; + height: number; + }; }>(), { width: 0, @@ -44,6 +48,10 @@ const props = withDefaults( wrapWidth: 0, wrapHeight: 0, zoom: 1, + correctionScrollSize: () => ({ + width: 0, + height: 0, + }), }, ); @@ -69,6 +77,7 @@ onMounted(() => { container: container.value, target: el.value, zoom: props.zoom, + correctionScrollSize: props.correctionScrollSize, }); scrollViewer.on('scroll', (data: ScrollViewerEvent) => { diff --git a/packages/editor/src/layouts/workspace/Stage.vue b/packages/editor/src/layouts/workspace/Stage.vue index 5069fcff..06e6b18f 100644 --- a/packages/editor/src/layouts/workspace/Stage.vue +++ b/packages/editor/src/layouts/workspace/Stage.vue @@ -1,5 +1,5 @@