summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-06-10 15:25:05 -0400
committerJules Laplace <jules@okfoc.us>2016-06-10 15:25:05 -0400
commitd3c355ce07e0d8ec41fedd9cde970f4a7c03dec6 (patch)
treeefca6f958c57c622cd5021a9c5dee4562774f63f /public
parent9d3c9cb918d03a8a30eb325e1f7e4d55f1765dcc (diff)
fix odd bugs that have appeared
Diffstat (limited to 'public')
-rw-r--r--public/assets/javascripts/rectangles/models/rect.js21
-rw-r--r--public/assets/javascripts/ui/blueprint/BlueprintView.js9
2 files changed, 19 insertions, 11 deletions
diff --git a/public/assets/javascripts/rectangles/models/rect.js b/public/assets/javascripts/rectangles/models/rect.js
index a4756ed..4f73bec 100644
--- a/public/assets/javascripts/rectangles/models/rect.js
+++ b/public/assets/javascripts/rectangles/models/rect.js
@@ -1,4 +1,3 @@
-
(function(){
var vec2
if ('window' in this) {
@@ -8,17 +7,17 @@
vec2 = require('./vec2')
FRONT = 0x1, BACK = 0x2, LEFT = 0x4, RIGHT = 0x8, FLOOR = 0x10, CEILING = 0x20
TOP = CEILING, BOTTOM = FLOOR
- function sidesToString(sides){
- var s = ""
- if (sides & FRONT) s += "front "
- if (sides & BACK) s += "back "
- if (sides & LEFT) s += "left "
- if (sides & RIGHT) s += "right "
- if (sides & TOP) s += "top "
- if (sides & BOTTOM) s += "bottom "
- return s
- }
}
+ function sidesToString(sides){
+ var s = ""
+ if (sides & FRONT) s += "front "
+ if (sides & BACK) s += "back "
+ if (sides & LEFT) s += "left "
+ if (sides & RIGHT) s += "right "
+ if (sides & TOP) s += "top "
+ if (sides & BOTTOM) s += "bottom "
+ return s
+ }
var Rect = function (x0,y0,x1,y1){
if (x0 instanceof vec2) {
diff --git a/public/assets/javascripts/ui/blueprint/BlueprintView.js b/public/assets/javascripts/ui/blueprint/BlueprintView.js
index e249c91..1858c3d 100644
--- a/public/assets/javascripts/ui/blueprint/BlueprintView.js
+++ b/public/assets/javascripts/ui/blueprint/BlueprintView.js
@@ -40,6 +40,15 @@ var BlueprintView = View.extend({
if (startPositionIsInARoom) {
return this.startPosition
}
+ else if (! regions.length) {
+ return {
+ x: 0,
+ y: viewHeight,
+ z: 0,
+ rotationX: 0,
+ rotationY: Math.PI/2,
+ }
+ }
else {
var center = regions[0].center()
return {