Skip to content

Misleading CanvasRenderingContext2D.drawImage signature #14592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nkemnitz opened this issue Mar 11, 2017 · 2 comments
Closed

Misleading CanvasRenderingContext2D.drawImage signature #14592

nkemnitz opened this issue Mar 11, 2017 · 2 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@nkemnitz
Copy link

TypeScript Version: 2.2.1

Current lib.dom.d.ts signature w/o types:

drawImage(image, offsetX, offsetY, width?, height?, canvasOffsetX?, canvasOffsetY?, canvasImageWidth?, canvasImageHeight?)

WHATWG HTML spec w/o types

drawImage(image, canvasOffsetX, canvasOffsetY)
drawImage(image, canvasOffsetX, canvasOffsetY, canvasImageWidth, canvasImageHeight)
drawImage(image, offsetX, offsetY, width, height, canvasOffsetX, canvasOffsetY, canvasImageWidth, canvasImageHeight)

The TS description matches the 9 parameter version of the Standard, but because they sneaked in the 4 additional parameters right after image, it doesn't fit the first two signatures.

I would create a PR and split the signature into three, if that is acceptable?

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Mar 17, 2017

Sounds reasonable. Sorry this took a while to get back to. Check out https://github.com/Microsoft/TSJS-lib-generator to send a PR. I think you want to look here.

@DanielRosenwasser DanielRosenwasser added Help Wanted You can do this Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Mar 17, 2017
@nkemnitz
Copy link
Author

No problem, PR #214 contains the suggested changes.

@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Mar 17, 2017
@mhegazy mhegazy self-assigned this Mar 17, 2017
@mhegazy mhegazy added this to the TypeScript 2.3 milestone Mar 17, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Mar 22, 2017
@zhengbli zhengbli removed the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Mar 23, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

4 participants