Skip to content

Commit fc0b1d5

Browse files
authored
Merge pull request #99 from DMU-DebugVisual/dongjun
애니메이션 시스템 최적화:Zoom 상태 유지 및 UI 통일
2 parents a548643 + 58bdb47 commit fc0b1d5

File tree

9 files changed

+1255
-1543
lines changed

9 files changed

+1255
-1543
lines changed

src/components/ide/AnimationFactory.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// AnimationFactory.js - DV-Flow v1.3 완전 대응 (업데이트)
1+
// AnimationFactory.js - DV-Flow v1.3 완전 대응 (key 수정)
22
import React from 'react';
33

44
// 실제 애니메이션 컴포넌트들 import
@@ -21,7 +21,7 @@ export class AnimationFactory {
2121
'insertion-sort': SortAnimation,
2222
'merge-sort': SortAnimation,
2323
'quick-sort': SortAnimation,
24-
'sort': SortAnimation, // 일반 정렬
24+
'sort': SortAnimation,
2525

2626
// ✅ 트리 구조
2727
'binary-tree': BinaryTreeAnimation,
@@ -71,8 +71,9 @@ export class AnimationFactory {
7171
console.warn('⚠️ 구버전 JSON 구조 감지! events 필드가 없습니다.');
7272
}
7373

74+
// ⚡ CRITICAL: Date.now() 제거! 고정된 key 사용
7475
return React.createElement(AnimationComponent, {
75-
key: `animation-${normalizedType}-${Date.now()}`,
76+
key: `animation-${normalizedType}`, // 타입별 고정 key
7677
animationType: normalizedType,
7778
...props
7879
});
@@ -147,14 +148,13 @@ export class AnimationFactory {
147148
const hasCompare = events.some(e => e.kind === 'compare');
148149
const hasSwap = events.some(e => e.kind === 'swap');
149150
if (hasCompare && hasSwap) {
150-
// 특정 정렬 알고리즘 감지 시도
151151
const hasPivot = events.some(e => e.viz?.pivot !== undefined);
152152
if (hasPivot) return 'quick-sort';
153153

154154
const hasMerge = events.some(e => e.kind === 'merge');
155155
if (hasMerge) return 'merge-sort';
156156

157-
return 'bubble-sort'; // 기본 정렬
157+
return 'bubble-sort';
158158
}
159159

160160
// 그래프 패턴

0 commit comments

Comments
 (0)