UNPKG

2.05 kBSource Map (JSON)View Raw
1{"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../src/Renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAU5B,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,KAAK,CAAC,aAAa;IACvD,YAAY,EACV,EAAE,EAAE,OAAO,EACX,MAAM,EACN,UAAU,GAAG,CAAC,EACd,UAAU,EACV,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACM;QACd,MAAM,WAAW,GACf,MAAM;YACL;gBACC,KAAK,EAAE,OAAO,CAAC,kBAAkB;gBACjC,MAAM,EAAE,OAAO,CAAC,mBAAmB;gBACnC,KAAK,EAAE,EAAE;gBACT,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAQ;gBACnC,mBAAmB,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAQ;gBACtC,YAAY,EAAE,OAAO,CAAC,mBAAmB;aACpB,CAAC;QAE1B,KAAK,CAAC;YACJ,MAAM,EAAE,WAAW;YACnB,OAAO;YACP,GAAG,KAAK;SACT,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAE/B,IAAI,KAAK,IAAI,MAAM,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC7B;QACD,IAAI,UAAU,EAAE;YACd,wEAAwE;YACxE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;SAChC;IACH,CAAC;CACF","sourcesContent":["import THREE from './Three';\n\ntype RendererProps = THREE.WebGLRendererParameters & {\n gl: WebGLRenderingContext;\n canvas?: HTMLCanvasElement;\n pixelRatio?: number;\n clearColor?: THREE.Color | string | number;\n width?: number;\n height?: number;\n};\nexport default class Renderer extends THREE.WebGLRenderer {\n constructor({\n gl: context,\n canvas,\n pixelRatio = 1,\n clearColor,\n width,\n height,\n ...props\n }: RendererProps) {\n const inputCanvas =\n canvas ||\n ({\n width: context.drawingBufferWidth,\n height: context.drawingBufferHeight,\n style: {},\n addEventListener: (() => {}) as any,\n removeEventListener: (() => {}) as any,\n clientHeight: context.drawingBufferHeight,\n } as HTMLCanvasElement);\n\n super({\n canvas: inputCanvas,\n context,\n ...props,\n });\n\n this.setPixelRatio(pixelRatio);\n\n if (width && height) {\n this.setSize(width, height);\n }\n if (clearColor) {\n // @ts-ignore: Type 'string' is not assignable to type 'number'.ts(2345)\n this.setClearColor(clearColor);\n }\n }\n}\n"]}
\No newline at end of file