(() => {
+ if (props.graph.isDragging) {
+ return {
+ left: addUnit(
+ use(props.graph.selected[0]?.parent, (p) =>
+ p ? getDeepOffset(p, 'x') : 0
+ ) +
+ rect.value.x +
+ rect.value.width / 2 -
+ (width.value + 16) / 2
+ ),
+ top: addUnit(
+ use(props.graph.selected[0]?.parent, (p) =>
+ p ? getDeepOffset(p, 'y') : 0
+ ) +
+ rect.value.y +
+ rect.value.height +
+ 10
+ ),
+ }
+ }
+
+ return {
+ display: 'none',
+ }
+ })
+
+ return () => (
+
+ X: {rect.value.x} Y: {rect.value.y}
+
+ )
+ },
+})
diff --git a/src/SaForm/graph.ts b/src/SaForm/graph.ts
index c73007b..1d24bf5 100644
--- a/src/SaForm/graph.ts
+++ b/src/SaForm/graph.ts
@@ -90,6 +90,7 @@ export interface BasicGraph {
selection: SelectionSetting
isDraft: boolean
+ isDragging?: boolean
grid: GridSetting
snapline: SnaplineSetting
scroller: Scroller
diff --git a/src/SaForm/utils/element.ts b/src/SaForm/utils/element.ts
index bd5f5f4..0b698dd 100644
--- a/src/SaForm/utils/element.ts
+++ b/src/SaForm/utils/element.ts
@@ -55,7 +55,12 @@ export const getDeepOffset = (
): number =>
(element.parent ? getDeepOffset(element.parent, attr) : 0) +
(attr === 'y' && isTab(element) ? element.attrs['tab-height'] : 0) +
- element.attrs[attr]
+ element.attrs[attr] +
+ (element.attrs['border-width'] &&
+ element.attrs['border-style'] &&
+ element.attrs['border-style'] !== 'none'
+ ? element.attrs['border-width']
+ : 0)
export const createCopyName = (set: Set, name: string): string => {
if (!name) return ''