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

Desired operations for Transform2D library #151

Closed
imeckler opened this Issue Jan 30, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@imeckler
Contributor

imeckler commented Jan 30, 2015

I think that the Transform2D type is a bit too abstract. I'm currently trying to debug something involving them and it's impossible to actually inspect them. The module itself provides no way to define functions out of the type, and it seems the only place Transform2Ds can be used is in Graphics.Collage.groupTransform. Such a library is of general use, i.e., not only with forms, and I think some version of the following functions would be quite reasonable to add:

apply : Transform2D -> (Float, Float) -> (Float, Float)

type alias TransformView =
  { matrix      : (Float, Float, Float, Float)
  , translation : (Float, Float)
  }
view : Transform2D -> TransformView

In fact these two functions are interderivable (up to floating point errors), so just one would be enough if you're all feeling spartan.

@identicalsnowflake

This comment has been minimized.

Show comment
Hide comment
@identicalsnowflake

identicalsnowflake Feb 1, 2015

I was hoping for something like this, too. I'm writing CSS bindings, and I'm trying to use Elm types as much as possible, and I wanted to accept the core type Transform2D for the CSS transform property, but I can't because there isn't any way to inspect the Transform2D object.

identicalsnowflake commented Feb 1, 2015

I was hoping for something like this, too. I'm writing CSS bindings, and I'm trying to use Elm types as much as possible, and I wanted to accept the core type Transform2D for the CSS transform property, but I can't because there isn't any way to inspect the Transform2D object.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz May 11, 2016

Member

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there.

That said, I would like to keep that API stable for now. I expect to be focusing on <canvas> for professional users and "friendly graphics" for learning as separate use cases. Progress will be made when those start happening.

Member

evancz commented May 11, 2016

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there.

That said, I would like to keep that API stable for now. I expect to be focusing on <canvas> for professional users and "friendly graphics" for learning as separate use cases. Progress will be made when those start happening.

@evancz evancz closed this May 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment