summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/javascripts/rectangles/engine/scenery/move.js2
-rw-r--r--public/assets/javascripts/rectangles/engine/sculpture/move.js16
-rw-r--r--public/assets/javascripts/rectangles/engine/sculpture/types/image.js2
-rw-r--r--public/assets/javascripts/rectangles/util/constants.js3
4 files changed, 16 insertions, 7 deletions
diff --git a/public/assets/javascripts/rectangles/engine/scenery/move.js b/public/assets/javascripts/rectangles/engine/scenery/move.js
index dd60a61..94c6281 100644
--- a/public/assets/javascripts/rectangles/engine/scenery/move.js
+++ b/public/assets/javascripts/rectangles/engine/scenery/move.js
@@ -28,7 +28,7 @@ Scenery.move = function(base){
base.remove()
return
}
-
+
// load the modal
app.controller.pick(base)
diff --git a/public/assets/javascripts/rectangles/engine/sculpture/move.js b/public/assets/javascripts/rectangles/engine/sculpture/move.js
index f968bcf..4f6d176 100644
--- a/public/assets/javascripts/rectangles/engine/sculpture/move.js
+++ b/public/assets/javascripts/rectangles/engine/sculpture/move.js
@@ -2,8 +2,9 @@
Sculpture.move = function(base){
var x, y, z, position, dimension, bounds
- var dragging = false, moved = false
+ var dragging = false, shiftPressed = false, moved = false
var oldState
+ var height, width
this.bind = function(){
Sculpture.mouse.bind_el(base.mx.el)
@@ -39,11 +40,13 @@ Sculpture.move = function(base){
e.clickAccepted = false
return
}
+ shiftPressed = e.shiftKey
dragging = true
moved = false
x = base.mx.x
y = base.mx.y
z = base.mx.z
+ height = base.mx.height * base.mx.scale
bounds = base.bounds
dimension = base.dimensions
@@ -63,9 +66,14 @@ Sculpture.move = function(base){
// here we need to move the element based on the XY coords, as
// base.mx.y = position.b + delta.b + dimension.b / 2
- base.mx.x = x + delta.a * cos(cam.rotationY) - delta.b * sin(cam.rotationY)
- base.mx.z = z + delta.a * sin(cam.rotationY) + delta.b * cos(cam.rotationY)
-
+ if (e.shiftKey) {
+ base.mx.y = clamp( y + delta.b, height/2 + sculpture_distance_from_floor, Infinity )
+ }
+ else {
+ base.mx.x = x + delta.a * cos(cam.rotationY) - delta.b * sin(cam.rotationY)
+ base.mx.z = z + delta.a * sin(cam.rotationY) + delta.b * cos(cam.rotationY)
+ }
+
if (editor.permissions.resize) {
Sculpture.resize.move_dots()
}
diff --git a/public/assets/javascripts/rectangles/engine/sculpture/types/image.js b/public/assets/javascripts/rectangles/engine/sculpture/types/image.js
index 3e5ab08..1a53f5b 100644
--- a/public/assets/javascripts/rectangles/engine/sculpture/types/image.js
+++ b/public/assets/javascripts/rectangles/engine/sculpture/types/image.js
@@ -25,7 +25,7 @@ Sculpture.types.image = Sculpture.types.base.extend(function(base){
})
if (opt.position) {
- opt.position.y = opt.position.y || this.scale * this.media.height/2 + 3
+ opt.position.y = opt.position.y || this.scale * this.media.height/2 + sculpture_distance_from_floor
opt.position.rotationY = opt.position.rotationY || scene.camera.rotationY
}
diff --git a/public/assets/javascripts/rectangles/util/constants.js b/public/assets/javascripts/rectangles/util/constants.js
index 3bc314c..a70cacd 100644
--- a/public/assets/javascripts/rectangles/util/constants.js
+++ b/public/assets/javascripts/rectangles/util/constants.js
@@ -25,7 +25,8 @@ var height_min = 200,
MAP_GRID_SIZE = 360 // 10 feet
var painting_distance_from_wall = 10,
- dot_distance_from_picture = 3
+ dot_distance_from_picture = 3,
+ sculpture_distance_from_floor = 3
var dot_hide_delay = 50, // ms
dot_side = 20