diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-11-04 14:44:02 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-11-04 14:44:02 -0500 |
| commit | 00778a168b7314039e95e856f6d41e05d0dbc4e4 (patch) | |
| tree | 3c4485d42b969ffebc1fef781ab4d2e3f66bc3e5 /public/assets/javascripts/rectangles/models/vec2.js | |
| parent | 9acdfee187cff9131e1add9e74a0eecb002ed1b5 (diff) | |
fix resize undo
Diffstat (limited to 'public/assets/javascripts/rectangles/models/vec2.js')
| -rw-r--r-- | public/assets/javascripts/rectangles/models/vec2.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/public/assets/javascripts/rectangles/models/vec2.js b/public/assets/javascripts/rectangles/models/vec2.js index f28df54..14d0e6b 100644 --- a/public/assets/javascripts/rectangles/models/vec2.js +++ b/public/assets/javascripts/rectangles/models/vec2.js @@ -206,7 +206,11 @@ return "[" + this.a + " " + this.b + "]" } vec2.prototype.serialize = function(){ - return [ ~~this.a, ~~this.b ] + return [ round(this.a), round(this.b) ] + } + vec2.prototype.deserialize = function(data){ + this.a = data[0] + this.b = data[1] } vec2.prototype.quantize = function(n){ n = n || 10 |
