Fix camera view projection issue

This commit is contained in:
pandamicro
2018-02-08 15:49:01 +08:00
parent ab72058841
commit dabdfc8b9b
+5 -6
View File
@@ -83,7 +83,6 @@ module.exports = {
this._camera.setNear(0.1);
this._camera.setFar(1024);
this._camera.setNode(this._cameraNode);
this.updateCameraViewport();
if (CC_EDITOR) {
this._camera.setColor(0, 0, 0, 0);
@@ -105,12 +104,12 @@ module.exports = {
}
let node = this._cameraNode;
let canvas = this.canvas;
let zeye = canvas.height / 1.1566;
node.x = canvas.width / 2;
node.y = canvas.height / 2;
let scaleX = cc.view.getScaleX();
let scaleY = cc.view.getScaleY();
let zeye = canvas.height / scaleY / 1.1566;
_pos.x = node.x = canvas.width / scaleX / 2;
_pos.y = node.y = canvas.height / scaleY / 2;
node.z = zeye;
_pos.x = canvas.width / 2;
_pos.y = canvas.height / 2;
_pos.z = 0;
node.lookAt(_pos);
},