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

Add graphics-transform adapter layer #24

Open
cromo opened this issue May 29, 2021 · 0 comments
Open

Add graphics-transform adapter layer #24

cromo opened this issue May 29, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@cromo
Copy link
Owner

cromo commented May 29, 2021

It's nice to have every layer that draws graphics to draw at the origin at a standard size so that they can easily be moved/attached to other locations or objects. In order to capture transformations of this kind and make them easy to carry around and swap out, we could have a graphics-transform adapter. It would:

  • Pass through all callbacks except draw
  • Accept a function that will perform the transform
  • When drawing, it
    1. Pushes the current transform on the stack
    2. Calls the passed function to perform the transform
    3. Passes through the callback to the nested layer
    4. Pops the transform stack
  • It should perform error checking around the provided functions to ensure that the transform stack doesn't grow unbounded
@cromo cromo added the enhancement New feature or request label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant