Skip to content

Commit 6f50588

Browse files
committed
graph fit(node, duration) fixed using @sechaparroc dummy node suggestion
1 parent 7c14baa commit 6f50588

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/nub/core/Graph.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,12 @@ public void fit(Node node, float duration) {
19131913
_interpolator.reset();
19141914
_interpolator.clear();
19151915
_interpolator.addKeyFrame(eye().detach());
1916-
_interpolator.addKeyFrame(node.detach(), duration);
1916+
// 2nd node is bit of a challenge. Note that:
1917+
//_interpolator.addKeyFrame(node.detach(), duration);
1918+
// doesn't work always since the node may be moving (see the Flock example)
1919+
Node dummy = new Node(node);
1920+
dummy.disableTagging();
1921+
_interpolator.addKeyFrame(dummy, duration);
19171922
_interpolator.run();
19181923
}
19191924
}

0 commit comments

Comments
 (0)