Preview at the bottom of mouse if too high
This commit is contained in:
parent
a6f637223f
commit
c0a2044118
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue