1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

update useThree

This commit is contained in:
Kevin Levron 2020-10-07 23:39:25 +02:00
parent 50af37552b
commit ece3164f22

View File

@ -34,7 +34,7 @@ export default function useThree() {
};
// handlers
let afterInitCallbacks = [];
const afterInitCallbacks = [];
let afterResizeCallbacks = [];
let beforeRenderCallbacks = [];
@ -243,9 +243,14 @@ export default function useThree() {
obj.composer.setSize(width, height);
}
if (obj.camera.type === 'OrthographicCamera') {
size.wWidth = obj.camera.right - obj.camera.left;
size.wHeight = obj.camera.top - obj.camera.bottom;
} else {
const wsize = getCameraSize();
size.wWidth = wsize[0]; size.wHeight = wsize[1];
}
}
/**
* calculate camera visible area size