place shape objects on frame

This commit is contained in:
Skyler Lehmkuhl 2024-11-17 05:22:40 -05:00
parent 277aec918c
commit f5113d6687
1 changed files with 4 additions and 2 deletions

View File

@ -82,6 +82,7 @@ class Curve {
class Frame { class Frame {
constructor() { constructor() {
this.keys = {} this.keys = {}
this.shapes = []
} }
} }
@ -157,7 +158,7 @@ class GraphicsObject {
child.scale = this.frames[this.currentFrame][idx].scale; child.scale = this.frames[this.currentFrame][idx].scale;
child.draw(context) child.draw(context)
} }
for (let shape of this.shapes) { for (let shape of this.frames[this.currentFrame].shapes) {
ctx.beginPath() ctx.beginPath()
ctx.moveTo(shape.startx, shape.starty) ctx.moveTo(shape.startx, shape.starty)
for (let curve of shape.curves) { for (let curve of shape.curves) {
@ -179,7 +180,8 @@ class GraphicsObject {
} }
} }
addShape(shape) { addShape(shape) {
this.shapes.push(shape) // this.shapes.push(shape)
this.frames[this.currentFrame].shapes.push(shape)
} }
} }