From 838ccfe6c2125e464d3c95c6e222e7e762dc8fd2 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 12 Aug 2014 18:19:33 -0400 Subject: undo stack for undo/redo --- public/assets/javascripts/rectangles/models/vec2.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'public/assets/javascripts/rectangles/models/vec2.js') diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index 104c6f7..214feb9 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -17,6 +17,10 @@ vec2.prototype.clone = function(){ return new vec2(this.a, this.b) } + vec2.prototype.assign = function(v){ + this.a = v.a + this.b = v.b + } vec2.prototype.abs = function(){ if (this.b < this.a) { this.invert() -- cgit v1.2.3-70-g09d2