mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 14:08:55 +08:00
1f45cc5dec
**Directory Structure Changes** - Renamed multiple block-related directories by removing the "block-" prefix: - `block-attachment` → `attachment` - `block-bookmark` → `bookmark` - `block-callout` → `callout` - `block-code` → `code` - `block-data-view` → `data-view` - `block-database` → `database` - `block-divider` → `divider` - `block-edgeless-text` → `edgeless-text` - `block-embed` → `embed`
11 lines
308 B
TypeScript
11 lines
308 B
TypeScript
import { clamp } from '@blocksuite/global/gfx';
|
|
|
|
import { GRID_GAP_MAX, GRID_GAP_MIN } from '../consts';
|
|
|
|
export function getBgGridGap(zoom: number) {
|
|
const step = zoom < 0.5 ? 2 : 1 / (Math.floor(zoom) || 1);
|
|
const gap = clamp(20 * step * zoom, GRID_GAP_MIN, GRID_GAP_MAX);
|
|
|
|
return Math.round(gap);
|
|
}
|