diff --git a/components/label/components/PaperContainer.tsx b/components/label/components/PaperContainer.tsx index 4566e76..2d5141d 100644 --- a/components/label/components/PaperContainer.tsx +++ b/components/label/components/PaperContainer.tsx @@ -1022,16 +1022,12 @@ const PaperContainer = ( parent: usePaperStore.getState().group, strokeScaling: false, }) - if (Math.abs(path.area) < useTopToolsStore.getState().checkSize) { - path.remove() + if (hollows[index]) { + path.data.isHollowPolygon = true + innerPaths.push(path) } else { - if (hollows[index]) { - path.data.isHollowPolygon = true - innerPaths.push(path) - } else { - path.fillColor = new paper.Color(fillColor) - outerPaths.push(path) - } + path.fillColor = new paper.Color(fillColor) + outerPaths.push(path) } } }) diff --git a/components/label/components/TopTools.tsx b/components/label/components/TopTools.tsx index ff47ff6..c41e7ca 100644 --- a/components/label/components/TopTools.tsx +++ b/components/label/components/TopTools.tsx @@ -92,7 +92,12 @@ import { useKeyboardStore } from "../useKeyBoardStore" import { usePaperStore } from "../usePaperStore" import { useRightToolsStore } from "../useRightToolsStore" import { useIntervalStore, useLabelTimeStore } from "../useTimerStore" -import { useTopToolsStore } from "../useTopToolsStore" +import { + DEFAULT_NODE_SIZE, + NODE_SIZE_MAX, + NODE_SIZE_MIN, + useTopToolsStore, +} from "../useTopToolsStore" import { getSubAttrStatus } from "../util" import { safeClone } from "../utils/clone" import { labelTypeMap, TaskStatusEnum } from "../utils/constants" @@ -222,13 +227,14 @@ const TopTools = ( setAssistToolEnabled, assistToolSize, setAssistToolSize, + nodeSize, + setNodeSize, needBackup, setNeedBackup, - checkSize, - setCheckSize, magnetFlag, setMagnetFlag, } = useTopToolsStore() + const [nodeSizeInput, setNodeSizeInput] = useState(nodeSize) const { pathGroupMap } = useRightToolsStore() const isAutoSave = useIntervalStore((state) => state.isAutoSave) @@ -247,6 +253,11 @@ const TopTools = ( ].filter(Boolean).length }, [projectDetail, showDescList, showGroupList, showObjectList, showTaskList]) + useEffect(() => { + setNodeSizeInput(nodeSize) + usePaperStore.getState().refreshNodeVisualSize() + }, [nodeSize]) + const toggleRightPanel = useCallback( (visible: boolean, setter: (val: boolean) => void) => { const nextVisible = !visible @@ -2188,23 +2199,39 @@ const TopTools = ( - { - if (v) setCheckSize(Number(v)) - }} - onFocus={() => { - useKeyEventStore.getState().setFocusInput(true) - }} - onBlur={() => { - useKeyEventStore.getState().setFocusInput(false) - }} - /> + + + + 节点 + + { + setNodeSizeInput(value) + }} + onFocus={() => { + useKeyEventStore.getState().setFocusInput(true) + }} + onBlur={(event) => { + useKeyEventStore.getState().setFocusInput(false) + const rawValue = event.currentTarget.value.trim() + const nextValue = + rawValue === "" ? DEFAULT_NODE_SIZE : Number(rawValue) + setNodeSize( + Number.isFinite(nextValue) ? nextValue : DEFAULT_NODE_SIZE + ) + }} + /> + + {renderEditIcon}