fix(editor): 编辑器分栏左右各设置最小宽度 fix #145

This commit is contained in:
roymondchen 2022-06-22 14:18:17 +08:00 committed by jia000
parent f9fd249fc4
commit 363330e07a

View File

@ -26,7 +26,9 @@ import type { GetColumnWidth, SetColumnWidth, StageRect, UiState } from '@editor
import BaseService from './BaseService'; import BaseService from './BaseService';
const DEFAULT_LEFT_COLUMN_WIDTH = 310; const DEFAULT_LEFT_COLUMN_WIDTH = 310;
const MIN_LEFT_COLUMN_WIDTH = 45;
const DEFAULT_RIGHT_COLUMN_WIDTH = 480; const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
const MIN_RIGHT_COLUMN_WIDTH = 1;
const COLUMN_WIDTH_STORAGE_KEY = '$MagicEditorColumnWidthData'; const COLUMN_WIDTH_STORAGE_KEY = '$MagicEditorColumnWidthData';
@ -117,11 +119,11 @@ class Ui extends BaseService {
}; };
if (left) { if (left) {
columnWidth.left = left; columnWidth.left = Math.max(left, MIN_LEFT_COLUMN_WIDTH);
} }
if (right) { if (right) {
columnWidth.right = right; columnWidth.right = Math.max(right, MIN_RIGHT_COLUMN_WIDTH);
} }
if (!center || center === 'auto') { if (!center || center === 'auto') {