place shape objects on frame
This commit is contained in:
parent
277aec918c
commit
f5113d6687
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue