From bb1c0998c3648cd01396dd6c807e26dcc3dadcfb Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 8 Feb 2026 12:18:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E5=BC=B9=E7=AA=97=E6=A0=B7=E5=BC=8F=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=B6=8A=E7=95=8C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/canvas/nodes/ImageNode.tsx | 86 ++++++--------------------- 1 file changed, 19 insertions(+), 67 deletions(-) diff --git a/components/canvas/nodes/ImageNode.tsx b/components/canvas/nodes/ImageNode.tsx index 3487e63..f4562af 100644 --- a/components/canvas/nodes/ImageNode.tsx +++ b/components/canvas/nodes/ImageNode.tsx @@ -407,25 +407,6 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) { return { top, left }; }; - const getNotePanelPosition = () => { - if (!containerRef.current || typeof window === "undefined") { - return { top: 0, left: 0 }; - } - - const rect = containerRef.current.getBoundingClientRect(); - const panelWidth = 300; - const spacing = 12; - const maxTop = Math.max(12, window.innerHeight - 360); - - let left = rect.right + spacing; - if (left + panelWidth > window.innerWidth - 12) { - left = Math.max(12, rect.left - panelWidth - spacing); - } - - const top = Math.min(Math.max(12, rect.top + 8), maxTop); - return { top, left }; - }; - const displayTitle = getImageNodeTitle(data, node.id); const handleSaveTitle = useCallback(() => { @@ -1814,66 +1795,37 @@ export function ImageNode({ node, isSelected }: ImageNodeProps) { document.body )} - {/* 图片备注面板 */} - {notePanelOpen && typeof document !== "undefined" && createPortal( -
e.stopPropagation()} - onPointerDown={(e) => e.stopPropagation()} - onClick={(e) => e.stopPropagation()} - > -
-
- - 图片备注 -
- -
- -
+ {/* 图片备注对话框 */} + + + + + + 图片备注 + + +