From 363330e07aea220e0a1efc76823ceeb810005865 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Wed, 22 Jun 2022 14:18:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E5=88=86=E6=A0=8F=E5=B7=A6=E5=8F=B3=E5=90=84=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=AE=BD=E5=BA=A6=20=20fix=20#145?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/services/ui.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/services/ui.ts b/packages/editor/src/services/ui.ts index bfa23fb2..63e087a0 100644 --- a/packages/editor/src/services/ui.ts +++ b/packages/editor/src/services/ui.ts @@ -26,7 +26,9 @@ import type { GetColumnWidth, SetColumnWidth, StageRect, UiState } from '@editor import BaseService from './BaseService'; const DEFAULT_LEFT_COLUMN_WIDTH = 310; +const MIN_LEFT_COLUMN_WIDTH = 45; const DEFAULT_RIGHT_COLUMN_WIDTH = 480; +const MIN_RIGHT_COLUMN_WIDTH = 1; const COLUMN_WIDTH_STORAGE_KEY = '$MagicEditorColumnWidthData'; @@ -117,11 +119,11 @@ class Ui extends BaseService { }; if (left) { - columnWidth.left = left; + columnWidth.left = Math.max(left, MIN_LEFT_COLUMN_WIDTH); } if (right) { - columnWidth.right = right; + columnWidth.right = Math.max(right, MIN_RIGHT_COLUMN_WIDTH); } if (!center || center === 'auto') {