Closed cdaein closed 1 year ago
When I use ratio option, I can see it affects pixel ratio of the canvas, but I get a type error
ratio
const two = new Two({ type: Two.Types.canvas, width: 500, height: 500, ratio: 1, // no type });
Error:
Argument of type '{ type: string; width: number; height: number; ratio: number; }' is not assignable to parameter of type '{ fullscreen?: boolean | undefined; fitted?: boolean | undefined; autostart?: boolean | undefined; width?: number | undefined; height?: number | undefined; type?: string | undefined; domElement?: HTMLElement | undefined; overdraw?: boolean | undefined; smoothing?: boolean | undefined; }'. Object literal may only specify known properties, and 'ratio' does not exist in type '{ fullscreen?: boolean | undefined; fitted?: boolean | undefined; autostart?: boolean | undefined; width?: number | undefined; height?: number | undefined; type?: string | undefined; domElement?: HTMLElement | undefined; overdraw?: boolean | undefined; smoothing?: boolean | undefined; }'.ts(2345)
Thanks for posting. This patch fixes that: https://github.com/jonobr1/two.js/pull/682
I'll be updating NPM in the coming days. Until then you can use the github repository directly through npm.
When I use
ratio
option, I can see it affects pixel ratio of the canvas, but I get a type errorError: