aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-05-22 11:27:38 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-05-22 11:27:38 -0500
commit2fa84b20fa657835510cb9be876817845d3df61b (patch)
treed07ababb415470fd003c1ac5b40f9d83475682d3 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx
parent755ea0668b559a2ae5f2c6dac86261db86e9ad2e (diff)
parentfdbff9dbb60b4af8f6feba67feda5376263dd7ca (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into script_documents
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 57f484214..a4120f958 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -100,13 +100,14 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
}
public static setupKeyframes(docs: Doc[], timecode: number, collection: Doc) {
- docs.forEach(doc => {
- doc["x-indexed"] = new List<number>(numberRange(timecode).map(i => undefined) as any as number[]);
- doc["y-indexed"] = new List<number>(numberRange(timecode).map(i => undefined) as any as number[]);
- doc["opacity-indexed"] = new List<number>(numberRange(timecode).map(i => 0));
- (doc["x-indexed"] as any).push(NumCast(doc.x));
- (doc["y-indexed"] as any).push(NumCast(doc.y));
- (doc["opacity-indexed"] as any).push(NumCast(doc.opacity, 1));
+ docs.forEach((doc, i) => {
+ const xlist = new List<number>(numberRange(timecode + 1).map(i => undefined) as any as number[]);
+ const ylist = new List<number>(numberRange(timecode + 1).map(i => undefined) as any as number[]);
+ xlist[Math.max(i - 1)] = xlist[timecode + 1] = NumCast(doc.x);
+ ylist[Math.max(i - 1)] = ylist[timecode + 1] = NumCast(doc.y);
+ doc["x-indexed"] = xlist;
+ doc["y-indexed"] = ylist;
+ doc["opacity-indexed"] = new List<number>(numberRange(timecode).map(i => 1));
doc.displayTimecode = ComputedField.MakeFunction("collection ? collection.currentTimecode : 0", {}, { collection });
doc.x = ComputedField.MakeInterpolated("x", "displayTimecode");
doc.y = ComputedField.MakeInterpolated("y", "displayTimecode");