mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-25 19:59:24 +08:00
fix(editor): 编辑器分栏左右各设置最小宽度 fix #145
This commit is contained in:
parent
f9fd249fc4
commit
363330e07a
@ -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') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user