UNPKG

974 BJavaScriptView Raw
1import THREE from './Three';
2export default class Renderer extends THREE.WebGLRenderer {
3 constructor({ gl: context, canvas, pixelRatio = 1, clearColor, width, height, ...props }) {
4 const inputCanvas = canvas ||
5 {
6 width: context.drawingBufferWidth,
7 height: context.drawingBufferHeight,
8 style: {},
9 addEventListener: (() => { }),
10 removeEventListener: (() => { }),
11 clientHeight: context.drawingBufferHeight,
12 };
13 super({
14 canvas: inputCanvas,
15 context,
16 ...props,
17 });
18 this.setPixelRatio(pixelRatio);
19 if (width && height) {
20 this.setSize(width, height);
21 }
22 if (clearColor) {
23 // @ts-ignore: Type 'string' is not assignable to type 'number'.ts(2345)
24 this.setClearColor(clearColor);
25 }
26 }
27}
28//# sourceMappingURL=Renderer.js.map
\No newline at end of file