diff options
| author | Jules Laplace <jules@okfoc.us> | 2014-09-29 18:17:55 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2014-09-29 18:17:55 -0400 |
| commit | 70e95dd95bccad8a62a2b26322836f4da4c34270 (patch) | |
| tree | b711b7966e67984d645a53abd3fc408557e092c2 | |
| parent | 2cbaec8ccf0dee45b93d19a60e9cac8d1d7d1336 (diff) | |
fix placing videos on wall
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/scenery/types/video.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/public/assets/javascripts/rectangles/engine/scenery/types/video.js b/public/assets/javascripts/rectangles/engine/scenery/types/video.js index e8bc7f7..ef25d8d 100644 --- a/public/assets/javascripts/rectangles/engine/scenery/types/video.js +++ b/public/assets/javascripts/rectangles/engine/scenery/types/video.js @@ -10,14 +10,20 @@ Scenery.types.video = Scenery.types.base.extend(function(base){ this.build() this.bind() - + if (opt.data) { + if (opt.wall) { + var position = opt.wall.mxToPosition(opt.data.position) + opt.index = opt.wall.surface.index_for_x( position.a, 0 ) + } + this.set_wall(opt) this.deserialize(opt.data) } else { - this.recenter() + this.set_wall(opt) + this.bounds && this.recenter() } - }, + }, build: function(){ switch (this.media.type) { |
