summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/shapes/shapelist.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-18 20:01:58 -0400
committerJules Laplace <jules@okfoc.us>2015-08-18 20:01:58 -0400
commitbbd62d9c7f3838d07e42e46c244c317a5dbdb5ae (patch)
tree6f197837e1438f4c5fc5eeac4cf6047b4ca6a8e8 /public/assets/javascripts/rectangles/engine/shapes/shapelist.js
parent83649f62ecbd92cc8a27ca47ac141cc3a81210a1 (diff)
clear shapes
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/shapes/shapelist.js')
-rw-r--r--public/assets/javascripts/rectangles/engine/shapes/shapelist.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/assets/javascripts/rectangles/engine/shapes/shapelist.js b/public/assets/javascripts/rectangles/engine/shapes/shapelist.js
index 932ce36..e86c5d6 100644
--- a/public/assets/javascripts/rectangles/engine/shapes/shapelist.js
+++ b/public/assets/javascripts/rectangles/engine/shapes/shapelist.js
@@ -13,6 +13,12 @@ var ShapeList = Fiber.extend(function(base){
this.shapes.splice(index, 1)
}
}
+ exports.destroy = function(){
+ this.shapes.forEach(function(shape){
+ shape.destroy()
+ })
+ this.shapes = []
+ }
exports.removeSegment = function (segment){
var shape = segment.shape
var head = shape.getHeadAtIndex(segment.head)