summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/models/wall.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-08-22 12:54:27 -0400
committerJulie Lala <jules@okfoc.us>2014-08-22 12:54:27 -0400
commit4ec4b0e42c06b63962658ae8b886ee9466d09a21 (patch)
tree5e3b0a52d61efa91495932f8cfe53a02dbe95af7 /public/assets/javascripts/rectangles/models/wall.js
parent978634c1c323240f36548468703a9512710c60e7 (diff)
reject image if it doesnt fit
Diffstat (limited to 'public/assets/javascripts/rectangles/models/wall.js')
-rw-r--r--public/assets/javascripts/rectangles/models/wall.js25
1 files changed, 11 insertions, 14 deletions
diff --git a/public/assets/javascripts/rectangles/models/wall.js b/public/assets/javascripts/rectangles/models/wall.js
index a8bcbd8..f6742ad 100644
--- a/public/assets/javascripts/rectangles/models/wall.js
+++ b/public/assets/javascripts/rectangles/models/wall.js
@@ -51,9 +51,7 @@
},
mousemove: function(e){
},
- mousedown: function(){
- // base.randomize_colors()
- // console.log(sidesToString(base.side))
+ mousedown: function(e){
if (Scenery.nextMedia) {
var scenery = Scenery.addNextToWall({
wall: base,
@@ -61,7 +59,10 @@
})
// scenery was not placed
- if (! scenery) return
+ if (! scenery) {
+ e.stopPropagation()
+ return
+ }
UndoStack.push({
type: 'create-scenery',
@@ -125,22 +126,18 @@
var position = new vec2(0,0)
switch (this.side) {
case FRONT:
- position.a = mx.x - mx.width / 2
- position.b = mx.y - mx.height / 2
- break
case BACK:
- position.a = mx.x - mx.width / 2
- position.b = mx.y - mx.height / 2
+ position.a = mx.x
+ position.b = mx.y
break
case LEFT:
- position.a = mx.z - mx.width / 2
- position.b = mx.y - mx.height / 2
- break
case RIGHT:
- position.a = mx.z - mx.width / 2
- position.b = mx.y - mx.height / 2
+ position.a = mx.z
+ position.b = mx.y
break
}
+// if (mx.width) { position.a -= mx.width / 2 }
+// if (mx.height) { position.b -= mx.height / 2 }
return position
}