Skip to content

Commit 877b1ab

Browse files
committed
fix: 修复标注标签位置偏移问题
- 移除CSS动画中的transform: scale()属性 - 该属性会覆盖SVG元素的transform属性导致标签位置错误 - 保留opacity动画效果
1 parent d2ecac4 commit 877b1ab

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/components/TreeCanvas.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,9 @@
8989
@keyframes annotationPulse {
9090
0%, 100% {
9191
opacity: 1;
92-
transform: scale(1);
9392
}
9493
50% {
9594
opacity: 0.9;
96-
transform: scale(1.05);
9795
}
9896
}
9997

src/components/TreeCanvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,8 @@ function renderAnnotations(
664664

665665
switch (annotation.position) {
666666
case 'top':
667-
// 确保标注不会超出画布顶部
668-
offsetY = Math.max(-45 - groupIndex * 28, -node.y + 15);
667+
// 标注显示在节点上方,每个标注间隔28px
668+
offsetY = -45 - groupIndex * 28;
669669
break;
670670
case 'bottom':
671671
offsetY = 40 + groupIndex * 28;

0 commit comments

Comments
 (0)