diff options
| author | Julie Lala <jules@okfoc.us> | 2014-06-20 01:40:43 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-06-20 01:40:43 -0400 |
| commit | 1a1009d5cbfb1deb7cc110bacf3fd76236cf25a9 (patch) | |
| tree | 5ee025477a0ccc54e2ec11c71bdac47d2092ad1e /public/assets/javascripts/rectangles/engine | |
| parent | befeb2ed9b7f7086ec0861cbfe4ab6450e1987af (diff) | |
resize based on magnitude..
Diffstat (limited to 'public/assets/javascripts/rectangles/engine')
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/scenery/resize.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/public/assets/javascripts/rectangles/engine/scenery/resize.js b/public/assets/javascripts/rectangles/engine/scenery/resize.js index 33efd05..50c97bd 100644 --- a/public/assets/javascripts/rectangles/engine/scenery/resize.js +++ b/public/assets/javascripts/rectangles/engine/scenery/resize.js @@ -161,19 +161,21 @@ Scenery.resize = new function(){ var x_sign = selected_dot.side & LEFT ? -1 : selected_dot.side & RIGHT ? 1 : 0 var y_sign = selected_dot.side & TOP ? -1 : selected_dot.side & BOTTOM ? 1 : 0 - - var translation = new vec2( x_sign * cursor.x.magnitude() * cursor_amp, y_sign * cursor.y.magnitude() * cursor_amp ) - // resize using scale here instead of width and height + var mag = cursor.magnitude() + + // fix resizing here +// obj.mx.scale = obj.media.scale +// var translation = new vec2( x_sign * cursor.x.magnitude() * cursor_amp, y_sign * cursor.y.magnitude() * cursor_amp ) if (selected_dot.side & LEFT_RIGHT) { // obj.mx.width = dimensions.a + translation.a - obj.mx.x = position.a + x_sign * cos(rotationY) * translation.a/2 * obj.mx.scale - obj.mx.z = position.c + x_sign * sin(rotationY) * translation.a/2 * obj.mx.scale + obj.mx.x = position.a + x_sign * cos(rotationY) * mag/2 * obj.mx.scale + obj.mx.z = position.c + x_sign * sin(rotationY) * mag/2 * obj.mx.scale } if (selected_dot.side & TOP_BOTTOM) { // obj.mx.height = dimensions.b + translation.b - obj.mx.y = position.b - y_sign * translation.b/2 * obj.mx.scale + obj.mx.y = position.b - y_sign * mag/2 * obj.mx.scale } // bounds = obj.wall.bounds_for(dimensions) |
