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

[css-paint-api] Specify explicitly that PaintSize.{width, height} may be fractional #479

Closed
chrishtr opened this issue Oct 14, 2017 · 2 comments

Comments

@chrishtr
Copy link

The paint API specifies that the width and height fields of PaintInfo are doubles, but
elsewhere in the spec (https://drafts.css-houdini.org/css-paint-api/#2d-rendering-context)
says to "Set bitmap dimensions for the context’s output bitmap to width and height", which
implies that the width and height are integers.

Instead, I suggest that phrase should be changed to "Set bitmap dimensions for the context’s output bitmap to the rounded values of width and height".

(Note: the actual device-pixel backing buffer may have a different size than the output bitmap. This
is accounted for by devicePixelRatio.)

@chrishtr
Copy link
Author

Also, an un-rounded width and height plus devicePixelRatio and specifying the top-left
of the painting canvas to be positioned at the device pixel location of the top-left of where
the element will actually be drawn to the screen, allows the developer, if they wish, to do pixel-perfect painting.

This is why it's important for width and height to be doubles.

@bfgeek
Copy link
Contributor

bfgeek commented Nov 9, 2017

This has been fixed by PR #500

@bfgeek bfgeek closed this as completed Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants