chore(editor): merge clamp functions (#10577)
Closes: [BS-2625](https://linear.app/affine-design/issue/BS-2625/合并clamp函数)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { clamp } from '@blocksuite/global/utils';
|
||||
|
||||
export const BLOCK_CHILDREN_CONTAINER_PADDING_LEFT = 24;
|
||||
export const NOTE_MIN_WIDTH = 450 + 24 * 2;
|
||||
export const NOTE_MIN_HEIGHT = 92;
|
||||
@@ -11,9 +13,6 @@ export enum NoteDisplayMode {
|
||||
EdgelessOnly = 'edgeless',
|
||||
}
|
||||
|
||||
export const clamp = (min: number, val: number, max: number) =>
|
||||
Math.min(Math.max(min, val), max);
|
||||
|
||||
export const bound01 = (n: number, max: number) => {
|
||||
n = clamp(0, n, max);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user