Fixed data type used in CanvasRenderingContext2D and ImageData#55
Merged
LostBeard merged 1 commit intoLostBeard:mainfrom Nov 3, 2025
Merged
Fixed data type used in CanvasRenderingContext2D and ImageData#55LostBeard merged 1 commit intoLostBeard:mainfrom
LostBeard merged 1 commit intoLostBeard:mainfrom
Conversation
…s all Double like it should be. Removed now redundant overloads in favor of the more descriptive variants.
Owner
|
That is awesome. I had used MDN which lacks specific number type information for those methods. To verify your changes I searched for better w3 specs for those 2 classes and found: w3.org/canvasrenderingcontext2d and whatwg.org/ImageData. The only issue I see is that the spec for ImageData uses |
Contributor
Author
|
That means we would need to cast it to uint in the CanvasRenderingContext2D when constructing those objects - i'll look into it further, only reason i changed that class was to fix compiler errors after adjusting all of the CanvasRenderingContext2D class methods. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've corrected the data type used throughout CanvasRenderingContext2D and the related ImageData class so it's all Double like it should be (number in TypeScript/Javascript is equivalent to Double, not int).
Making these changes i noticed there were some additional overloads with double for some methods that lacked the full XML documentation so i removed them, there was also a overload that was less descriptive i chose to remove in favor of the more informational version.
NOTE: these are breaking changes (binary level but also partially the removal of some overloads causing some parameters to change their names potentially).