From bd28ce6d5ab959d3e0365428076205e37344f48c Mon Sep 17 00:00:00 2001 From: "zhili.wzl" Date: Wed, 1 Dec 2021 17:55:41 +0800 Subject: [PATCH] chore: improve code --- formily/antd/src/components/FormGrid/preview.tsx | 1 - packages/core/src/effects/useResizeEffect.ts | 0 packages/react/src/widgets/AuxToolWidget/styles.less | 8 ++++---- 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 packages/core/src/effects/useResizeEffect.ts diff --git a/formily/antd/src/components/FormGrid/preview.tsx b/formily/antd/src/components/FormGrid/preview.tsx index 025168c57..c39b8d194 100644 --- a/formily/antd/src/components/FormGrid/preview.tsx +++ b/formily/antd/src/components/FormGrid/preview.tsx @@ -86,7 +86,6 @@ FormGrid.Behavior = createBehavior( selector: (node) => node.props['x-component'] === 'FormGrid.GridColumn', designerProps: { droppable: true, - resizeXPath: 'x-component-props.gridSpan', allowDrop: (node) => node.props['x-component'] === 'FormGrid', propsSchema: createFieldSchema(AllSchemas.FormGrid.GridColumn), }, diff --git a/packages/core/src/effects/useResizeEffect.ts b/packages/core/src/effects/useResizeEffect.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/react/src/widgets/AuxToolWidget/styles.less b/packages/react/src/widgets/AuxToolWidget/styles.less index e1a6b7960..7f618eafd 100644 --- a/packages/react/src/widgets/AuxToolWidget/styles.less +++ b/packages/react/src/widgets/AuxToolWidget/styles.less @@ -231,28 +231,28 @@ &.left { left: 0; top: 50%; - transform: translate(-50%, -50%); + transform: translate(calc(-50% - 1px), -50%); cursor: ew-resize; } &.right { left: 100%; top: 50%; - transform: translate(-50%, -50%); + transform: translate(calc(-50% + 1px), -50%); cursor: ew-resize; } &.top { left: 50%; top: 0; - transform: translate(-50%, -50%); + transform: translate(-50%, calc(-50% - 1px)); cursor: ns-resize; } &.bottom { left: 50%; top: 100%; - transform: translate(-50%, -50%); + transform: translate(-50%, calc(-50% + 1px)); cursor: ns-resize; } }