Skip to content

Commit 73740a3

Browse files
authored
Set min area size (#567)
1 parent 6813313 commit 73740a3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/components/EditorCanvas/Canvas.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
ObjectType,
88
gridSize,
99
gridCircleRadius,
10+
minAreaSize,
1011
} from "../../data/constants";
1112
import { Toast } from "@douyinfe/semi-ui";
1213
import Table from "./Table";
@@ -376,6 +377,8 @@ export default function Canvas() {
376377
break;
377378
}
378379

380+
if(newDims.width < minAreaSize || newDims.height < minAreaSize) return;
381+
379382
updateArea(areaResize.id, { ...newDims });
380383
return;
381384
}

src/data/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const gridCircleRadius = 0.85;
2323
export const tableFieldHeight = 36;
2424
export const tableColorStripHeight = 7;
2525
export const pngExportPixelRatio = 4;
26+
export const minAreaSize = 120;
2627

2728
export const Cardinality = {
2829
ONE_TO_ONE: "one_to_one",

0 commit comments

Comments
 (0)