Commit c751240
committed
fix(graph-ui): keep the camera on the focused node after fly-to
The fly-to animation moved only the camera and called lookAt, leaving the OrbitControls pivot at the origin, so OrbitControls re-centred the view on the next frame and snapped the camera back once the animation ended.
Lerp the controls target to the focus point as well so the view stays on the clicked node or cluster and orbits around it afterwards.
Signed-off-by: Zadak <rarepops@protonmail.com>1 parent dc8c5be commit c751240
1 file changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
| |||
179 | 195 | | |
180 | 196 | | |
181 | 197 | | |
182 | | - | |
| 198 | + | |
183 | 199 | | |
184 | 200 | | |
185 | 201 | | |
| |||
0 commit comments