Skip to content

Rendering and size of snapshot for placed elements #16

@khushalsagar

Description

@khushalsagar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions