summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/models/vec2.js
diff options
context:
space:
mode:
authorryderr <r@okfoc.us>2014-11-04 15:35:50 -0500
committerryderr <r@okfoc.us>2014-11-04 15:35:50 -0500
commit39d502a7609da3ada15be163b8400994c9edecd6 (patch)
tree2f4947dcbbd91f0f0c515120ccaa625a7352597a /public/assets/javascripts/rectangles/models/vec2.js
parent5df29b91f28f9557bd7dcd3d27969b06890610ec (diff)
parent43b211e416fb7154079586de7b75807bd1a5ac28 (diff)
Merge branch 'master' of github.com:okfocus/vvalls
Diffstat (limited to 'public/assets/javascripts/rectangles/models/vec2.js')
-rw-r--r--public/assets/javascripts/rectangles/models/vec2.js6
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