mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
update useThree
This commit is contained in:
parent
50af37552b
commit
ece3164f22
@ -34,7 +34,7 @@ export default function useThree() {
|
||||
};
|
||||
|
||||
// handlers
|
||||
let afterInitCallbacks = [];
|
||||
const afterInitCallbacks = [];
|
||||
let afterResizeCallbacks = [];
|
||||
let beforeRenderCallbacks = [];
|
||||
|
||||
@ -243,8 +243,13 @@ export default function useThree() {
|
||||
obj.composer.setSize(width, height);
|
||||
}
|
||||
|
||||
const wsize = getCameraSize();
|
||||
size.wWidth = wsize[0]; size.wHeight = wsize[1];
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user