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

Rendering and size of snapshot for placed elements #16

Open
khushalsagar opened this issue Nov 5, 2024 · 0 comments
Open

Rendering and size of snapshot for placed elements #16

khushalsagar opened this issue Nov 5, 2024 · 0 comments

Comments

@khushalsagar
Copy link
Collaborator

It's unclear how we should reason about exposing the size of the element snapshots to script. There's 2 categories of APIs:

  • placeElement and drawElement on 2D canvas where the author can ask to render the snapshot at a point (x, y). But it's ambiguous what should be at (x, y) since there can be multiple reference boxes to use from the box model, or the snapshot's size itself which can have overflow. For example placeElement(element, 0, 0) where the element has a shadow. For the snapshot to not clip, we need to talk in terms of the snapshot size.
    One option is to make this configurable.

  • The texImage2D style of API where the author gets back a texture for the element. In this case the texture size would be exposed to the author and would need to be the actual snapshot size. We could expose offsets into the snapshot for the reference boxes if needed.

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

1 participant