From 96f1fac44f3161474ef56fbea9a781a4952be03f Mon Sep 17 00:00:00 2001 From: regischen Date: Wed, 22 Nov 2023 11:48:56 +0800 Subject: [PATCH] fix: hand mode in share --- .../blocks/src/page-block/edgeless/edgeless-page-block.ts | 4 ++++ .../blocks/src/page-block/edgeless/services/tools-manager.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/blocks/src/page-block/edgeless/edgeless-page-block.ts b/packages/blocks/src/page-block/edgeless/edgeless-page-block.ts index 2717d9c8d7ed..5c0abf107d12 100644 --- a/packages/blocks/src/page-block/edgeless/edgeless-page-block.ts +++ b/packages/blocks/src/page-block/edgeless/edgeless-page-block.ts @@ -654,6 +654,10 @@ export class EdgelessPageBlockComponent extends BlockElement< this._initViewport(); + if (this.page.readonly) { + this.tools.setEdgelessTool({ type: 'pan', panning: true }); + } + requestAnimationFrame(() => { this._handleToolbarFlag(); this.requestUpdate(); diff --git a/packages/blocks/src/page-block/edgeless/services/tools-manager.ts b/packages/blocks/src/page-block/edgeless/services/tools-manager.ts index 4b075e05caba..40e9d5f3da3b 100644 --- a/packages/blocks/src/page-block/edgeless/services/tools-manager.ts +++ b/packages/blocks/src/page-block/edgeless/services/tools-manager.ts @@ -441,6 +441,7 @@ export class EdgelessToolsManager { editing: false, } ) => { + if (this.page.readonly && edgelessTool.type !== 'pan') return; if (this.edgelessTool === edgelessTool) return; const lastType = this.edgelessTool.type; this._controllers[lastType].beforeModeSwitch(edgelessTool);