From f5113d6687312abdb367d262026c3f554c385c0b Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Sun, 17 Nov 2024 05:22:40 -0500 Subject: [PATCH] place shape objects on frame --- src/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 50e421c..8980fe9 100644 --- a/src/main.js +++ b/src/main.js @@ -82,6 +82,7 @@ class Curve { class Frame { constructor() { this.keys = {} + this.shapes = [] } } @@ -157,7 +158,7 @@ class GraphicsObject { child.scale = this.frames[this.currentFrame][idx].scale; child.draw(context) } - for (let shape of this.shapes) { + for (let shape of this.frames[this.currentFrame].shapes) { ctx.beginPath() ctx.moveTo(shape.startx, shape.starty) for (let curve of shape.curves) { @@ -179,7 +180,8 @@ class GraphicsObject { } } addShape(shape) { - this.shapes.push(shape) + // this.shapes.push(shape) + this.frames[this.currentFrame].shapes.push(shape) } }