summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/util/sort.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-08-04 17:41:04 -0400
committerJules Laplace <jules@okfoc.us>2014-08-04 17:41:04 -0400
commite2e1565f5cd3154c0f515dbe3d88c9943dd0580e (patch)
treede7ad8f6d9951ef9642142e799881221adbb129d /public/assets/javascripts/rectangles/util/sort.js
parentbe7412073a5e0b6641f125f29d254315f50bc95c (diff)
group walls and render using 'wireframe' look
Diffstat (limited to 'public/assets/javascripts/rectangles/util/sort.js')
-rw-r--r--public/assets/javascripts/rectangles/util/sort.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/util/sort.js b/public/assets/javascripts/rectangles/util/sort.js
index 7aa40a2..cf8d6b1 100644
--- a/public/assets/javascripts/rectangles/util/sort.js
+++ b/public/assets/javascripts/rectangles/util/sort.js
@@ -95,9 +95,38 @@
return a.x < b.x ? -1 : a.x == b.x ? 0 : 1
}
sort.compare_z = function (a,b){
- return a.z > b.z ? -1 : a.z == b.z ? 0 : 1
+ return a.z < b.z ? -1 : a.z == b.z ? 0 : 1
}
-
+ sort.compare_xz = function(a,b){
+ if (a.x < b.x) {
+ return -1
+ }
+ if (a.x > b.x) {
+ return 1
+ }
+ if (a.z < b.z) {
+ return -1
+ }
+ if (a.z > b.z) {
+ return 1
+ }
+ return 0
+ }
+ sort.compare_zx = function(a,b){
+ if (a.z < b.z) {
+ return -1
+ }
+ if (a.z > b.z) {
+ return 1
+ }
+ if (a.x < b.x) {
+ return -1
+ }
+ if (a.x > b.x) {
+ return 1
+ }
+ return 0
+ }
if ("window" in this) {
window.sort = sort
}