diff --git a/static/js/prototype/Previewer.js b/static/js/prototype/Previewer.js index 4211183..60b6136 100644 --- a/static/js/prototype/Previewer.js +++ b/static/js/prototype/Previewer.js @@ -14,6 +14,11 @@ Previewer.prototype.render = function(prev, container_width, container_height) { if (!this.fixed) { left = Math.floor(prev.x - width/2); bottom = Math.floor(this.renderer.domElement.height - prev.y + height/5); + if (bottom + height > this.renderer.domElement.height) { + bottom -= 7 * height / 5; + console.log(bottom); + } + console.log(bottom, this.renderer.domElement.height); } else { left = 0; bottom = 0; diff --git a/static/js/prototype/raycasterTools.js b/static/js/prototype/raycasterTools.js index a16013f..38e75fd 100644 --- a/static/js/prototype/raycasterTools.js +++ b/static/js/prototype/raycasterTools.js @@ -10,8 +10,8 @@ var CameraSelecter = function(renderer, cameras, buttonManager) { CameraSelecter.prototype.pointedCamera = function() { var returnCamera; - var x = ( this.mouse.x / renderer.domElement.width ) * 2 - 1; - var y = - (this.mouse.y / renderer.domElement.height) * 2 + 1; + var x = ( this.mouse.x / this.renderer.domElement.width ) * 2 - 1; + var y = - (this.mouse.y / this.renderer.domElement.height) * 2 + 1; var camera = this.cameras.mainCamera(); @@ -52,6 +52,7 @@ CameraSelecter.prototype.pointedCamera = function() { // } } } + this.currentPointedCamera = null; } CameraSelecter.prototype.update = function(event) {