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

align and friends should be in terms of a new 'Alignable' class instead of 'Boundable' #31

Closed
fryguybob opened this issue Aug 4, 2012 · 0 comments

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=64. Original issue from byor...@gmail.com on January 22, 2012, 06:22:36 PM UTC)

The fact that 'align' and friends currently require a Boundable constraint is an implementation detail. Things that are Boundable can certainly be aligned using the current code. However, there are other things which are not Boundable but which it makes sense to align: the particular motivating example being animations.

Just as was already done with the new Juxtaposable class, aligning ought to be done in terms of a new class, something like

class Alignable a where
alignBy :: V a -> Scalar (V a) -> a -> a

with a function 'alignByDefault' provided which gives the current implementation in terms of Boundable etc. Then we can also make an Alignable instance for animations, which simply does the alignment pointwise over time.

@ghost ghost assigned byorgey Aug 4, 2012
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

2 participants