Skip to content
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

Should CanvasElement height and width return floats? #101

Open
tom-sherman opened this issue Jun 12, 2022 · 2 comments
Open

Should CanvasElement height and width return floats? #101

tom-sherman opened this issue Jun 12, 2022 · 2 comments

Comments

@tom-sherman
Copy link
Contributor

Seems like a pretty nuts use case to have a canvas with a greater height or width than ~2million but I think it's possible.

Maybe this applies in other places too? I think in general most of the web APIs should return floats as they map to JS numbers.

@TheSpyder
Copy link
Owner

The main use case I see for floats in the DOM is not large numbers, but fractions. Setting a fractional pixel isn’t common but having them returned by measurement apis can be.

so it’s not a no, but I’d prefer to see use case examples before changing an int to a float 🤔

@tom-sherman
Copy link
Contributor Author

Good points. I'm thinking more about the bindings be as spec compliant as possible - where the spec defines a JS number I think it makes sense to use a float without really needing to think about the use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants